Clean Up Orphaned postmeta Data

Sometimes you run into a time where you need to go into the database and delete items from the posts table.  So after doing this you could have a lot of extra data getting stored in the postmeta table that is no longer needed.  This is a simple MySQL command that can...

Color Inverter

I found this nice little function to take a color and give you its inverse color.  It is pretty useful to display a color on a background that is opposite so you can ensure it will display correctly without having to know what the color is. <?php // color_inverse...

Create CSV File using PHP

Came across this nice little bit of code to write a CSV file on the fly using PHP and grabbing the data from a MySQL database.  Thank you Stephen Morley for authoring a great little how to. // output headers so that the file is downloaded rather than displayed...

Creating a Testimonial System using WordPress Creation Kit

First step is to create the Post Type under the Post Type Creator.  Under Supports: you should only leave title checked off.  For post_type in the example I am giving I used ‘wpcmsninja_reviews' but you can set this to whatever you would like, just need to make...

Cron Jobs and WordPress

function some_plugin_activation() { if (!wp_next_scheduled( ‘some_plugin_check_cron_event' )) { some_plugin_schedule_event(); } else { some_plugin_deactivation(); some_plugin_schedule_event(); } } function some_plugin_deactivation() { if ( wp_next_scheduled (...