WP_CLI
Runner::cmd_starts_with
Checks if the arguments passed to the WP-CLI binary start with the specified prefix.
Метод класса: Runner{}
Хуков нет.
Возвращает
true|false. true if the arguments passed to the WP-CLI binary start with the specified prefix, false otherwise.
Использование
// private - только в коде основоного (родительского) класса $result = $this->cmd_starts_with( $prefix );
- $prefix(массив) (обязательный)
- An array of strings specifying the expected start of the arguments passed to the WP-CLI binary. For example, ['user', 'list'] checks if the arguments passed to the WP-CLI binary start with user list.
Код Runner::cmd_starts_with() Runner::cmd starts with WP-CLI 2.13.0-alpha
private function cmd_starts_with( $prefix ) {
return array_slice( $this->arguments, 0, count( $prefix ) ) === $prefix;
}