This is a filter to take Gravity Forms format dates (dd/mm/yyyy) and convert them to WP-Types format dates (integer). Read More
In this example the event start & end dates are entered as timestamps using WP-Types. It could also be modified for Advanced Custom Fields which uses strings. Read More
This allows you to indent lists/paragraphs in the TinyMCE WYSIWYG editor using Tab, and outdent using Shift+Tab. I wrote it because I write a lot of nested lists, it’s tedious using the keyboard to indent and outdent, and I couldn’t find any… Read More
My sister came to visit and brought me homemade cake!
With wp_insert_post() and wp_set_post_terms()... Read More
While entering several back-dated posts into a WordPress blog, I got annoyed at the date fields being in American month-day-year format and decided to fix it. Read More
Stan the cat meets Becks the dog.
This script takes an image and resizes it to the given dimensions, then saves that version on the filesystem so Apache can serve it directly in the future. Read More
WordPress saves post password cookies for 10 days, and there is no setting or filter to change that, but you can use this code to replace the form action entirely. Read More
Most instructions for using Capistrano tell you how to make it restart Phusion Passenger by touching the restart.txt file, but this doesn’t immediately restart the app – instead the first person to try to use the application will cause it to be… Read More
// Generate the contents of the file somehow $content = '...'; // Zip the file $zipFile = tempnam(sys_get_temp_dir(), 'zipfile'); $zip = new ZipArchive; $zip->open($zipFile, ZipArchive::OVERWRITE); $zip->addFromString('sample.txt', $content); $zip->close(); // Do something with the file (e.g. attach it to an email)… Read More