Skip to content

Instantly share code, notes, and snippets.

@maheshwaghmare
Created June 2, 2020 14:51
Show Gist options
  • Save maheshwaghmare/1f8ffe11db0ba5d4c7e5fab34e465a6a to your computer and use it in GitHub Desktop.
Save maheshwaghmare/1f8ffe11db0ba5d4c7e5fab34e465a6a to your computer and use it in GitHub Desktop.
Add a task which perform in the scheduled event. See https://maheshwaghmare.com/doc/wordpress-cron/
<?php
/**
* Task to perform
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*
* @return void
*/
if( ! function_exists( 'prefix_cron_task' ) ) :
function prefix_cron_task() {
error_log( 'Called' );
}
add_action( 'prefix_cron_hook', 'prefix_cron_task' );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment