Yet another programmer blogging about code

PHP DateInterval can’t have both weeks and days

January 30, 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.

Gravity Forms add-ons need to have capabilities

January 1, 2017

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

exim4 with wildcard email aliases

December 31, 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.

Customise WooCommerce out of stock message

December 23, 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

November 26, 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.

So, 2016 just happened

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

October 10, 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.

Comma-separated vulnerabilities

October 8, 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

August 21, 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.

Disable scroll wheel on Events Manager location maps

August 15, 2015

Events Manager is a really nice, easy to customise plugin for showing events on WordPress websites. One gripe I always have with it is that the location maps zoom when you use the mouse scroll wheel, something I always turn off when I add a map to a page. Here’s how to fix it.