public function deleteAccount($userToDelete)
    {
        if ($userId = $this->userNameExists($userToDelete)) {
            if (is_multisite()) {
                if ($reassign = $this->reassignToUserId()) {
                    foreach ($this->sites as $site) {
                        remove_user_from_blog($userId, $site->blog_id, $reassign);
                    }
                    $this->db->delete($this->db->users, array('ID' => $userId));
                }
            } else {
                if ($reassign = $this->reassignToUserId()) {
                    wp_delete_user($userId, $reassign);
                }
            }
        }
    }
public function deleteAccount($userToDelete)
    {
        if ($userId = $this->userNameExists($userToDelete)) {
            if (is_multisite()) {
                if ($reassign = $this->reassignToUserId()) {
                    foreach ($this->sites as $site) {
                        remove_user_from_blog($userId, $site->blog_id, $reassign);
                    }
                    $this->db->delete($this->db->users, array('ID' => $userId));
                }
            } else {
                if ($reassign = $this->reassignToUserId()) {
                    wp_delete_user($userId, $reassign);
                }
            }
        }
    }
public function deleteAccount ( $ userToDelete ) { if ( $ userId = $ this -> userNameExists ( $ userToDelete ) ) { if ( is_multisite ( ) ) { if ( $ reassign = $ this -> reassignToUserId ( ) ) { foreach ( $ this -> sites as $ site ) { remove_user_from_blog ( $ userId , $ site -> blog_id , $ reassign ) ; } $ this -> db -> delete ( $ this -> db -> users , array ( 'ID' => $ userId ) ) ; } } else { if ( $ reassign = $ this -> reassignToUserId ( ) ) { wp_delete_user ( $ userId , $ reassign ) ; } } } }
Delete and reassign content to user id defined by reassignToUserId function.
@param  $userName the username that should be deleted.
@return array
Delete and reassign content to user id defined by reassignToUserId function .