Skip to content

Instantly share code, notes, and snippets.

@Tusko
Forked from moskalukigor/functions.php
Created December 7, 2016 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tusko/48770cc0c30c48f47499d775c8763e0a to your computer and use it in GitHub Desktop.
Save Tusko/48770cc0c30c48f47499d775c8763e0a 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