ActionScheduler_CanceledAction

Represents a stored action that has been canceled. It behaves like a finished action but ensures it uses a null schedule regardless of the schedule passed to its constructor.

Source: classes/actions/ActionScheduler_CanceledAction.php

Class Hierarchy

ActionScheduler_Action
└── ActionScheduler_FinishedAction
    └── ActionScheduler_CanceledAction

Constructor

__construct( string $hook, array $args = array(), ?ActionScheduler_Schedule $schedule = null, string $group = '' )

Calls the parent constructor with the provided hook, args, schedule, and group. After construction, it enforces a null schedule when the passed $schedule is null:

  • If $schedule is null, it calls set_schedule( new ActionScheduler_NullSchedule() ).

This ensures canceled actions always have a null schedule representation, even if the caller passes no schedule.

Behavior

  • Inherits execute() from ActionScheduler_FinishedAction, which does nothing.
  • Inherits is_finished() from ActionScheduler_FinishedAction, which returns true.

Usage Notes

ActionScheduler_ActionFactory::get_stored_action() uses this class when the stored status is ActionScheduler_Store::STATUS_CANCELED. For canceled actions, if the provided schedule is not already a ActionScheduler_CanceledSchedule or ActionScheduler_NullSchedule, the factory wraps it in ActionScheduler_CanceledSchedule before instantiating the action.