Action_Scheduler\WP_CLI

Action_Command::createpublicWC 1.0

Creates a new scheduled action.

OPTIONS

<hook>
Name of the action hook.
<start>
A unix timestamp representing the date you want the action to start. Also 'async' or 'now' to enqueue an async action.
[--args=<args>]
JSON object of arguments to pass to callbacks when the hook triggers.
--- default: []
---
[--cron=<cron>]
A cron-like schedule string (https://crontab.guru/).
--- default: ''
---
[--group=<group>]
The group to assign this job to.
--- default: ''
---
[--interval=<interval>]
Number of seconds to wait between runs.
--- default: 0
---

EXAMPLES

wp action-scheduler action create hook_async async
wp action-scheduler action create hook_single 1627147598
wp action-scheduler action create hook_recurring 1627148188 --interval=5
wp action-scheduler action create hook_cron 1627147655 --cron='5 4 * * *'

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

Хуков нет.

Возвращает

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

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

$Action_Command = new Action_Command();
$Action_Command->create( $args, $assoc_args );
$args(массив) (обязательный)
Positional arguments.
$assoc_args(массив) (обязательный)
Keyed arguments.

Код Action_Command::create() WC 10.0.2

public function create( array $args, array $assoc_args ) {
	require_once 'Action/Create_Command.php';
	$command = new Action\Create_Command( $args, $assoc_args );
	$command->execute();
}