Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created June 17, 2022 16:30
Show Gist options
  • Save lukecav/f4cf69b02d11624da4752e12ffcbe42c to your computer and use it in GitHub Desktop.
Save lukecav/f4cf69b02d11624da4752e12ffcbe42c to your computer and use it in GitHub Desktop.
Disable the Action Scheduler default queue runner
function asdds_disable_default_runner() {
if ( class_exists( 'ActionScheduler' ) ) {
remove_action( 'action_scheduler_run_queue', array( ActionScheduler::runner(), 'run' ) );
}
}
// ActionScheduler_QueueRunner::init() is attached to 'init' with priority 1, so we need to run after that
add_action( 'init', 'asdds_disable_default_runner', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment