Menu

Snippets

Yet another programmer blogging about code

Author Archive

Payment receipts with Gravity Forms and eWAY

Tuesday, November 14th, 2017

Gravity Forms email notifications can be used to send simple payment receipts for eWAY transactions. (more…)

PHP DateInterval can’t have both weeks and days

Monday, January 30th, 2017

PHP has some handy Date classes, including one for specifying date intervals. But you need to be wary of some idiosyncrasies, as I just found out. (more…)

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. (more…)

exim4 with wildcard email aliases

Saturday, December 31st, 2016

When you configure exim4 as your email transport, you will likely need to tell it to replace some user names with aliases. To make your life simpler, use wildcards to do the job for you. (more…)

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. (more…)

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. (more…)

So, 2016 just happened

Saturday, November 26th, 2016

Wow. It’s been over a year since my last blog post. 2016 seems to have just steamrolled over me. This is not good! But I’m not going to let 2016 beat me completely, so there will be a few blog posts over the next few weeks. Get back in your box, 2016, I’m not done.

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. (more…)

Comma-separated vulnerabilities

Thursday, October 8th, 2015

If you accept user input and then export it as CSV, please read this now! James Kettle very neatly explains how something as simple as a CSV export can be used to deliver exploits. I didn’t know about this before today; hat tip to Gravity Forms and, via them, Ninja Forms.

Load Gravity Forms stylesheets in page head

Friday, August 21st, 2015

Gravity Forms normally loads its stylesheets in the page head, where they belong. It does that only on pages which have forms, which is nice. If you use a widget to host your form, however, it can’t detect that until it renders the widget… too late to load the stylesheets in the head. At that point, it just pulls them directly into the page body. (more…)