Last active
April 3, 2017 13:01
-
-
Save avillegasn/5ea7c46af0b7deb0e9079a36e11afdb9 to your computer and use it in GitHub Desktop.
Schedule a task that executes once in the future at the specified time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_task() { | |
// Do something. Anything. | |
}//end my_task() | |
add_action( 'my_action', 'my_task' ); | |
// Execute my_task one hour from now... | |
wp_schedule_single_event( time() + 3600, 'my_action' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment