WordPress.org

Make WordPress Core

Ticket #14094: 14094.patch

File 14094.patch, 1.2 KB (added by prettyboymp, 8 years ago)
  • wp-admin/includes/user.php

     
    204204        else
    205205                $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
    206206
    207         return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
     207        $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
     208
     209        if( !is_multisite() )
     210                $query .= " AND meta_value != '0'";
     211        else
     212                $query .= " AND meta_value not like '%\"subscriber\"%'";
     213               
     214        return $wpdb->get_col( $query );
    208215}
    209216
    210217/**
     
    262269                $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
    263270
    264271        $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
    265         if ( $exclude_zeros )
    266                 $query .= " AND meta_value != '0'";
     272        if ( $exclude_zeros ) {
     273                if( !is_multisite() )
     274                        $query .= " AND meta_value != '0'";
     275                else
     276                        $query .= " AND meta_value not like '%\"subscriber\"%'";
     277        }
    267278
    268279        return $wpdb->get_col( $query );
    269280}