STATUS_COMPLETE
STATUS_COMPLETE = 'complete'
Class ActionScheduler_Store
$max_args_length : int
Maximum length of args.
$store : \ActionScheduler_Store
ActionScheduler_Store instance.
save_action(\ActionScheduler_Action $action, null|\DateTime $scheduled_date = null) : int
Save action.
\ActionScheduler_Action | $action | Action to save. |
null|\DateTime | $scheduled_date | Optional Date of the first instance to store. Otherwise uses the first date of the action's schedule. |
The action ID
find_action(string $hook, array $params = array()) : string|null
Find an action.
Note: the query ordering changes based on the passed 'status' value.
string | $hook | Action hook. |
array | $params | Parameters of the action to find. |
ID of the next action matching the criteria or NULL if not found.
query_actions(array $query = array(), string $query_type = 'select') : string|array|null
Query for action count or list of action IDs.
array | $query | { Query filtering options.
} |
string | $query_type | Whether to select or count the results. Default, select. |
The IDs of actions matching the query. Null on failure.
stake_claim(int $max_actions = 10, \DateTime|null $before_date = null, array $hooks = array(), string $group = '') : \ActionScheduler_ActionClaim
Make a claim.
int | $max_actions | Maximum number of actions to claim. |
\DateTime|null | $before_date | Claim only actions schedule before the given date. Defaults to now. |
array | $hooks | Claim only actions with a hook or hooks. |
string | $group | Claim only actions in the given group. |
validate_sql_comparator(string $comparison_operator) : string
Validate SQL operator.
string | $comparison_operator | Operator. |
None found |
get_scheduled_date_string(\ActionScheduler_Action $action, null|\DateTime $scheduled_date = null) : string
Get the time MySQL formatted date/time string for an action's (next) scheduled date.
\ActionScheduler_Action | $action | Action. |
null|\DateTime | $scheduled_date | Action's schedule date (optional). |
None found |
get_scheduled_date_string_local(\ActionScheduler_Action|null $action, null|\DateTime $scheduled_date = null) : string
Get the time MySQL formatted date/time string for an action's (next) scheduled date.
\ActionScheduler_Action|null | $action | Action. |
null|\DateTime | $scheduled_date | Action's scheduled date (optional). |
None found |
validate_args(mixed $args, int $action_id) : mixed
Validate that we could decode action arguments.
mixed | $args | The decoded arguments. |
int | $action_id | The action ID. |
When the decoded arguments are invalid.
None found |
validate_schedule(mixed $schedule, int $action_id) : mixed
Validate a ActionScheduler_Schedule object.
mixed | $schedule | The unserialized ActionScheduler_Schedule object. |
int | $action_id | The action ID. |
When the schedule is invalid.
None found |
validate_action(\ActionScheduler_Action $action) : mixed
InnoDB indexes have a maximum size of 767 bytes by default, which is only 191 characters with utf8mb4.
Previously, AS wasn't concerned about args length, as we used the (unindex) post_content column. However, with custom tables, we use an indexed VARCHAR column instead.
\ActionScheduler_Action | $action | Action to be validated. |
When json encoded args is too long.
None found |
bulk_cancel_actions(int[] $action_ids) : void
Cancel a set of action IDs.
int[] | $action_ids | List of action IDs. |
since | 3.0.0 |
---|