Instantly share code, notes, and snippets.

What would you like to do?
//this schedules the event (time+3 seconds) with arguments that are passed to the function
wp_schedule_single_event( time() + 3, 'my_action', array($permalink) );
//this is the task that gets added via add_action, should go in functions.php or other parent-level functions file
function my_task($permalink) {
echo $permalink;
add_action( 'my_action', 'my_task' );
//this shows the cron queue
// error_log(print_r(_get_cron_array(),1));
my_action = tag that gets added via add_action, and recalled via schedule_single_event
my_task = function that connected to the tag, and run when called
$permalink = parameter that is passed from the scheduler to the future run function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment