ActionScheduler_RecurringActionScheduler::init
Initialize the instance. Should only be run on a single instance per request.
Method of the class: ActionScheduler_RecurringActionScheduler{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ActionScheduler_RecurringActionScheduler = new ActionScheduler_RecurringActionScheduler(); $ActionScheduler_RecurringActionScheduler->init(): void;
ActionScheduler_RecurringActionScheduler::init() ActionScheduler RecurringActionScheduler::init code WC 11.0.1
public function init(): void {
add_action( self::RUN_SCHEDULED_RECURRING_ACTIONS_HOOK, array( $this, 'run_recurring_scheduler_hook' ) );
// Also run the check during queue processing, so installs without admin traffic still schedule the recurring action.
add_action( 'action_scheduler_before_process_queue', array( $this, 'schedule_recurring_scheduler_hook' ) );
if ( is_admin() && ! wp_doing_ajax() && ! wp_is_serving_rest_request() ) {
add_action( 'action_scheduler_init', array( $this, 'schedule_recurring_scheduler_hook' ) );
}
}