Yet another programmer blogging about code

Archive for the ‘Snippets’ Category

Enqueue scripts on the WordPress front end and login page

Wednesday, August 8th, 2018

If you want to load a script or stylesheet on both the WordPress front end and login page, here’s how to register it once and load it in the appropriate places.

Gravity Forms and WooCommerce country codes

Friday, June 1st, 2018

Gravity Forms and its User Registration add-on make it really easy to create custom registration pages. One problem you’ll hit if you combine that with WooCommerce is that WooCommerce uses standard country codes, but Gravity Forms uses country names. But that can be fixed.

Restrict Amazon SES by domain name

Monday, April 9th, 2018

Amazon Simple Email Service (SES) makes it easy, and cheap, to send emails reliably from a website. Here’s how to set it up for use with multiple domains.

Select PayPal landing page for Easy Digital Downloads

Monday, February 19th, 2018

Easy Digital Downloads comes with a PayPal Standard payment gateway, which lets us get our store up and selling quickly and cheaply. Let’s get it to select a better landing page with PayPal Standard, and make our credit card customers happier.

Localising a Gravity Forms add-on

Thursday, January 25th, 2018

The Gravity Forms Add-on Framework makes the job of creating an add-on really easy. But there’s a couple of problems with letting it load our text domain for us:

Gravity Forms add-ons need to have capabilities

Sunday, January 1st, 2017

TIL that you need to give Gravity Forms add-ons some capabilities, otherwise they might disappear from the WordPress admin.

Customise WooCommerce out of stock message

Friday, December 23rd, 2016

Sometimes the WooCommerce out of stock message isn’t quite appropriate. Here’s a couple of ways to change that message.

Searching custom meta on custom post types

Saturday, November 26th, 2016

Ever needed to search for a post by something other than the title or post content? If you’ve built a website with custom post types that have additional fields, it’s a good chance that admins will need to search on your custom meta.

VBScript For Next and Continue

Saturday, October 10th, 2015

I still get the occasional Classic ASP VBScript maintenance job from time to time, and it reminds me of the language statements it just doesn’t have. Like “continue”, great for skipping a bunch of logic inside a For loop. Turns out, there is a nice simple way to get that functionality.