update_user_meta( $user_id, 'primary_blog',
$new_id );
update_user_meta( $user_id, 'source_domain',
$new_domain );
} $user =
get_userdata( $user_id );
if ( !
$user ) { restore_current_blog();
return new WP_Error( 'user_does_not_exist',
__( 'That user does not exist.'
) );
} $user->
remove_all_caps();
$blogs =
get_blogs_of_user( $user_id );
if ( count( $blogs ) === 0
) { update_user_meta( $user_id, 'primary_blog', ''
);
update_user_meta( $user_id, 'source_domain', ''
);
} if ( $reassign ) { $reassign =
(int) $reassign;
$post_ids =
$wpdb->
get_col( $wpdb->
prepare( "SELECT ID FROM
$wpdb->posts WHERE post_author = %d",
$user_id ) );
$link_ids =
$wpdb->
get_col( $wpdb->
prepare( "SELECT link_id FROM
$wpdb->links WHERE link_owner = %d",
$user_id ) );