ActionScheduler_Action::execute()publicWC 1.0

Executes the action.

If no callbacks are registered, an exception will be thrown and the action will not be fired. This is useful to help detect cases where the code responsible for setting up a scheduled action no longer exists.

Method of the class: ActionScheduler_Action{}

Hooks from the method


null. Nothing (null).


$ActionScheduler_Action = new ActionScheduler_Action();

ActionScheduler_Action::execute() code WC 8.6.1

public function execute() {
	$hook = $this->get_hook();

	if ( ! has_action( $hook ) ) {
		throw new Exception(
				/* translators: 1: action hook. */
				__( 'Scheduled action for %1$s will not be executed as no callbacks are registered.', 'woocommerce' ),

	do_action_ref_array( $hook, array_values( $this->get_args() ) );