Yoast\WP\SEO
Loader::load_commands
Loads all registered commands.
Commands that opt in to conditional loading by implementing Loadable_Interface are skipped when their conditionals are not met.
Метод класса: Loader{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->load_commands();
Код Loader::load_commands() Loader::load commands Yoast 28.0
protected function load_commands() {
foreach ( $this->commands as $class ) {
if ( \is_subclass_of( $class, Loadable_Interface::class )
&& ! $this->conditionals_are_met( $class )
) {
continue;
}
$command = $this->get_class( $class );
if ( $command === null ) {
continue;
}
WP_CLI::add_command( $class::get_namespace(), $command );
}
}