Snippets

Load Gravity Forms stylesheets in page head

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.

Remove register link from WordPress wp-login.php

I recently had to enable user registrations on a WordPress multisite, so that shops on that site could allow customers to register. I don't want users to register any other way, only through specific applications on specific subsites. Enabling user registrations adds a "register" link to the wp-login.php script page. That invites trouble!

Remove the WordPress post date filter on custom post type admin pages

WordPress custom post types can be very useful for storing all sorts of different types of data in WordPress -- and I should really write a post about that some time. But the date a post was published, i.e. its post_date, isn't important for many custom post types. So why have a drop-down list of dates to filter your custom posts types by if you don't need it?

Stop CloudFlare Rocketscript breaking WordPress plugin scripts

CloudFlare offers a service called Rocketscript, which compresses, concatenates, and defers any JavaScript on your web pages. On some websites, it can make a significant difference to the apparent page load time, because it waits until the web browser has loaded the page before it loads and executes scripts. Of course, that sometimes means it breaks things! Fortunately, CloudFlare offers a way to avoid that, and it's possible to use it on your WordPress plugin scripts.