Updates using Transient Data

Here some useful activation and update hooks. <?php add_action( ‘upgrader_process_complete', ‘some_plugin_upgrade_completed', 10, 2 ); function some_plugin_upgrade_completed( $upgrader_object, $options ) { // The path to our plugin's main file...

Adding Validation to a WordPress Creation Toolkit Field

So I ran into a need to validate an email address for a frontend posting of a custom post type using Cozmos Labs WordPress Creation Toolkit.  Here is the code that I used to be able to accomplish that.  There is some commented out code that allows for you to see what...

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 (...

Current Year Shortcode

Sometimes you will want to output the current year within your site.  It is very useful with not having to update the Copyright notice in the footer of your site. Place the following code within your functions.php in the child theme and you are good to use the...

WordPress Databases – Using dbDelta

There are plenty of times you need to create extra database tables for storing data within WordPress.  Sometimes a scope of an addon has changed and you need to modify the table.  Using dbDelta within WordPress can allow you to modify the table without having to use...