From 0fad23034c543c86496d4236d00897e56d543f47 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 24 Apr 2009 16:53:35 +0000 Subject: [PATCH] Better error messages. Props DD32. see #7875 git-svn-id: http://svn.automattic.com/wordpress/trunk@11080 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-upgrader.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 2c3a73306b..0fd476c5c5 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -722,8 +722,12 @@ class WP_Upgrader_Skin { if ( is_string($errors) ) { $this->feedback($errors); } elseif ( is_wp_error($errors) && $errors->get_error_code() ) { - foreach ( $errors->get_error_messages() as $message ) - $this->feedback($message); + foreach ( $errors->get_error_messages() as $message ) { + if ( $errors->get_error_data() ) + $this->feedback($message . ' ' . $errors->get_error_data() ); + else + $this->feedback($message); + } } } @@ -731,10 +735,12 @@ class WP_Upgrader_Skin { if ( isset( $this->upgrader->strings[$string]) ) $string = $this->upgrader->strings[$string]; - $args = func_get_args(); - $args = array_splice($args, 1); - if ( !empty($args) ) - $string = vsprintf($string, $args); + if ( strpos($string, '%') !== false ) { + $args = func_get_args(); + $args = array_splice($args, 1); + if ( !empty($args) ) + $string = vsprintf($string, $args); + } if ( empty($string) ) return; show_message($string);