diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index b62e1d0b2d..9350a77dc8 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -135,6 +135,9 @@ function wpmu_delete_user( $id ) { $id = (int) $id; $user = new WP_User( $id ); + if ( !$user->exists() ) + return false; + do_action( 'wpmu_delete_user', $id ); $blogs = get_blogs_of_user( $id ); diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index 1d60aa57e3..ea3bdbf6a9 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -240,6 +240,9 @@ function wp_delete_user( $id, $reassign = 'novalue' ) { $id = (int) $id; $user = new WP_User( $id ); + if ( !$user->exists() ) + return false; + // allow for transaction statement do_action('delete_user', $id);