Make WordPress Core

Ticket #29785: user_count_normalsite_multisite.2.patch

File user_count_normalsite_multisite.2.patch, 727 bytes (added by dots, 7 years ago)

Tested in #4

  • user.php

     
    854854                $select_count = implode(', ', $select_count);
    855855
    856856                // Add the meta_value index to the selection list, then run the query.
    857                 $row = $wpdb->get_row( "SELECT $select_count, COUNT(*) FROM $wpdb->usermeta WHERE meta_key = '{$blog_prefix}capabilities'", ARRAY_N );
    858 
     857                $row = $wpdb->get_row( "SELECT $select_count, COUNT(*) FROM $wpdb->usermeta JOIN $wpdb->users ON user_id = ID WHERE meta_key = '{$blog_prefix}capabilities'", ARRAY_N );
     858               
     859               
    859860                // Run the previous loop again to associate results with role names.
    860861                $col = 0;
    861862                $role_counts = array();