Properly wipe capabilities from new site-independent multisite users by using the right key.

props wonderboymusic. fixes #15627

git-svn-id: https://develop.svn.wordpress.org/trunk@23307 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2013-01-18 15:30:55 +00:00
parent 926edeb4ee
commit df47c013ec

View File

@ -916,8 +916,10 @@ function wpmu_create_user( $user_name, $password, $email) {
if ( is_wp_error( $user_id ) )
return false;
$user = new WP_User( $user_id );
// Newly created users have no roles or caps until they are added to a blog.
delete_user_option( $user_id, 'capabilities' );
delete_user_option( $user_id, $user->cap_key );
delete_user_option( $user_id, 'user_level' );
do_action( 'wpmu_new_user', $user_id );