Action_Scheduler\WP_CLI
Action_Command::create()
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 * * *'
Method of the class: Action_Command{}
No Hooks.
Return
null
. Nothing (null).
Usage
$Action_Command = new Action_Command(); $Action_Command->create( $args, $assoc_args );
- $args(array) (required)
- Positional arguments.
- $assoc_args(array) (required)
- Keyed arguments.
Action_Command::create() Action Command::create code WC 9.8.1
public function create( array $args, array $assoc_args ) { require_once 'Action/Create_Command.php'; $command = new Action\Create_Command( $args, $assoc_args ); $command->execute(); }