ActionScheduler::is_class_cli()
Determine if the class is one of our WP CLI classes.
Method of the class: ActionScheduler{}
No Hooks.
Return
true|false
.
Usage
$result = ActionScheduler::is_class_cli( $class );
- $class(string) (required)
- The class name.
Changelog
Since 3.0.0 | Introduced. |
ActionScheduler::is_class_cli() ActionScheduler::is class cli code WC 9.2.3
protected static function is_class_cli( $class ) { static $cli_segments = array( 'QueueRunner' => true, 'Command' => true, 'ProgressBar' => true, ); $segments = explode( '_', $class ); $segment = isset( $segments[ 1 ] ) ? $segments[ 1 ] : $class; return isset( $cli_segments[ $segment ] ) && $cli_segments[ $segment ]; }