Show error data in message. Props DD32. see #5586

git-svn-id: http://svn.automattic.com/wordpress/trunk@7206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-10 07:45:46 +00:00
parent dad505b57e
commit 331efc3e25
1 changed files with 6 additions and 2 deletions

View File

@ -68,8 +68,12 @@ endforeach;
}
function show_message($message) {
if ( is_wp_error($message) )
$message = $message->get_error_message();
if( is_wp_error($message) ){
if( $message->get_error_data() )
$message = $message->get_error_message() . ': ' . $message->get_error_data();
else
$message = $message->get_error_message();
}
echo "<p>$message</p>";
}