Better error messages. Props DD32. see #7875

git-svn-id: https://develop.svn.wordpress.org/trunk@11080 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-04-24 16:53:35 +00:00
parent 63a54ef5f3
commit f309ae3dff
1 changed files with 12 additions and 6 deletions

View File

@ -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);