WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/25/2017 12:23:44 AM (3 years ago)
Author:
johnbillion
Message:

Users: Ensure that users with no role on a site are taken into consideration when listing users on Multisite.

This ensures that users who are a member of a site but have no role are correctly listed on the Users screen and can be filtered from the 'None' role filter.

Props tobi823, flixos90, scottlee

Fixes #36196

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r41027 r41138  
    9999                'number' => $users_per_page,
    100100                'offset' => ( $paged-1 ) * $users_per_page,
    101                 'include' => wp_get_users_with_no_role(),
     101                'include' => wp_get_users_with_no_role( $this->site_id ),
    102102                'search' => $usersearch,
    103103                'fields' => 'all_with_meta'
     
    178178            $url = 'site-users.php?id=' . $this->site_id;
    179179            switch_to_blog( $this->site_id );
    180             $users_of_blog = count_users();
     180            $users_of_blog = count_users( 'time', $this->site_id );
    181181            restore_current_blog();
    182182        } else {
     
    370370
    371371        foreach ( $this->items as $userid => $user_object ) {
    372             if ( is_multisite() && empty( $user_object->allcaps ) )
    373                 continue;
    374 
    375372            echo "\n\t" . $this->single_row( $user_object, '', '', isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
    376373        }
Note: See TracChangeset for help on using the changeset viewer.