WP_CLI::warning
Display warning message prefixed with "Warning: ".
Warning message is written to STDERR, or discarded when --quiet flag is supplied.
Use instead of WP_CLI::debug() when script execution should be permitted to continue.
# `wp plugin activate` skips activation when plugin is network active.
$status = $this->get_status( $plugin->file );
// Network-active is the highest level of activation status
if ( 'active-network' === $status ) {
WP_CLI::warning( "Plugin '{$plugin->name}' is already network active." );
continue;
}
Метод класса: WP_CLI{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = WP_CLI::warning( $message );
Код WP_CLI::warning() WP CLI::warning WP-CLI 2.13.0-alpha
public static function warning( $message ) {
if ( null === self::$logger ) {
return;
}
self::$logger->warning( self::error_to_string( $message ) );
}