WP_CLI::error_multi_line()public staticWP-CLI 1.0

Display a multi-line error message in a red box. Doesn't exit script.

Error message is written to STDERR.

Method of the class: WP_CLI{}

No Hooks.

Return

null. Nothing.

Usage

$result = WP_CLI::error_multi_line( $message_lines );
$message_lines(array) (required)
Multi-line error message to be displayed.

WP_CLI::error_multi_line() code WP-CLI 2.7.0-alpha

public static function error_multi_line( $message_lines ) {
	if ( null === self::$logger ) {
		return;
	}

	if ( ! isset( self::get_runner()->assoc_args['completions'] ) && is_array( $message_lines ) ) {
		self::$logger->error_multi_line( array_map( [ __CLASS__, 'error_to_string' ], $message_lines ) );
	}
}