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.

Метод класса: ActionScheduler_Action{}

Хуки из метода

Возвращает

null. Ничего (null).

Использование

$ActionScheduler_Action = new ActionScheduler_Action();
$ActionScheduler_Action->execute();

Код ActionScheduler_Action::execute() WC 8.9.0

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

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

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