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

git-svn-id: https://develop.svn.wordpress.org/trunk@23380 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-02-02 04:41:02 +00:00
parent 795ea73568
commit bb904fcf2b
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);