Skip to content

Instantly share code, notes, and snippets.

@matgargano
Created April 17, 2014 12:56
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 matgargano/10981294 to your computer and use it in GitHub Desktop.
Save matgargano/10981294 to your computer and use it in GitHub Desktop.
Cron on save_post (or whatever action)... (simulates) asynchroncity
add_action( 'save_post', function(){
wp_schedule_single_event( time(), 'action_to_run' );
});
add_action( 'action_to_run', 'function_to_run' );
function function_to_run(){
//asynchronous code to run!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment