mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-31 21:48:36 +01:00
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:
parent
574eb39978
commit
55ba72f46e
@ -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 );
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user