diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php
index a3bce779fc..7f7db0b774 100644
--- a/wp-admin/admin-ajax.php
+++ b/wp-admin/admin-ajax.php
@@ -215,9 +215,8 @@ case 'add-user' :
require_once( ABSPATH . WPINC . '/registration-functions.php');
$user_id = add_user();
if ( is_wp_error( $user_id ) ) {
- foreach( $user_id->get_error_codes() as $code)
- foreach( $user_id->get_error_messages($code) as $message )
- echo "$message
";
+ foreach( $user_id->get_error_messages() as $message )
+ echo "$message
";
exit;
} elseif ( !$user_id ) {
die('0');
diff --git a/wp-admin/profile-update.php b/wp-admin/profile-update.php
index 47b6d789d8..4a500e2c8b 100644
--- a/wp-admin/profile-update.php
+++ b/wp-admin/profile-update.php
@@ -10,9 +10,8 @@ if ( !$_POST )
$errors = edit_user($user_ID);
if ( is_wp_error( $errors ) ) {
- foreach( $errors->get_error_codes() as $code)
- foreach( $errors->get_error_messages($code) as $message )
- echo "$message
";
+ foreach( $errors->get_error_messages() as $message )
+ echo "$message
";
exit;
}
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index 128da67d3e..615e0cf11e 100644
--- a/wp-admin/user-edit.php
+++ b/wp-admin/user-edit.php
@@ -63,9 +63,8 @@ if (!current_user_can('edit_users'))