WP_CLI\Context
Auto::deduce_best_context
Deduce the best context to run the current command in.
Метод класса: Auto{}
Хуков нет.
Возвращает
Строку. Context to use.
Использование
// private - только в коде основоного (родительского) класса $result = $this->deduce_best_context();
Код Auto::deduce_best_context() Auto::deduce best context WP-CLI 2.13.0-alpha
private function deduce_best_context() {
if ( $this->is_command_to_run_as_admin() ) {
return Context::ADMIN;
}
return Context::CLI;
}