WP_CLI::warning()
Display warning message prefixed with "Warning: ".
Warning message is written to STDERR.
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.8.0-alpha
public static function warning( $message ) { if ( null === self::$logger ) { return; } self::$logger->warning( self::error_to_string( $message ) ); }