From 0021a7363bce5dae043c8f0512b7f1c467126930 Mon Sep 17 00:00:00 2001 From: tolgap Date: Tue, 30 Apr 2013 11:39:58 +0200 Subject: [PATCH] Check empty version for mu-plugins, remove unnecessary formatting --- php/WP_CLI/CommandWithUpgrade.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/php/WP_CLI/CommandWithUpgrade.php b/php/WP_CLI/CommandWithUpgrade.php index a994eb22..01d1c06a 100644 --- a/php/WP_CLI/CommandWithUpgrade.php +++ b/php/WP_CLI/CommandWithUpgrade.php @@ -48,8 +48,10 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command { $line = ' '; } $line .= $this->format_status( $details['status'], 'short' ); - $line .= " " . str_pad( $details['name'], $padding ); - $line .= "%n " . $this->format_version( $details['version'] ) . "%n"; + $line .= " " . str_pad( $details['name'], $padding ). "%n"; + if ( !empty( $details['version'] ) ) { + $line .= " " . $details['version']; + } \WP_CLI::line( $line ); } @@ -199,10 +201,6 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command { return $this->get_color( $status ) . $this->map[ $format ][ $status ]; } - protected function format_version( $version ) { - return '' . $version; - } - private function get_color( $status ) { static $colors = array( 'inactive' => '', -- 2.11.0