Confirm a user exists before deleting them in wp_delete_user() and wpmu_delete_user(). props scribu, fixes #23067.

git-svn-id: http://core.svn.wordpress.org/trunk@23380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-02-02 04:41:02 +00:00
parent 574eb39978
commit 55ba72f46e
2 changed files with 6 additions and 0 deletions

View File

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

View File

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