Skip to content

Instantly share code, notes, and snippets.

@moskalukigor
Created December 7, 2016 13:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save moskalukigor/6adaeba72ecd97c6a6c5180c4fcd0366 to your computer and use it in GitHub Desktop.
Save moskalukigor/6adaeba72ecd97c6a6c5180c4fcd0366 to your computer and use it in GitHub Desktop.
scheduler wp
add_action('init', 'apiSynchronization_activation');
function apiSynchronization_activation(){
if ( !wp_next_scheduled( 'apiSynchronization' ) ) {
wp_schedule_event( time(), 'twicedaily', 'apiSynchronization');
}
}
add_action('apiSynchronization', 'apiSync', 100);
function apiSync()
{
//func
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment