WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/18/2010 11:34:36 PM (11 years ago)
Author:
ryan
Message:

Multisite and formatting cleanups. Introduce get_allowed_themes(). see #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/user.php

    r12726 r12755  
    198198function get_author_user_ids() {
    199199    global $wpdb;
    200     if( !is_multisite() ) {
     200    if ( !is_multisite() )
    201201        $level_key = $wpdb->get_blog_prefix() . 'user_level';
    202     } else {
     202    else
    203203        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
    204     }
     204
    205205    return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
    206206}
     
    221221    $editable = get_editable_user_ids( $user_id );
    222222
    223     if( !$editable ) {
     223    if ( !$editable ) {
    224224        return false;
    225225    } else {
     
    253253            return array();
    254254    }
    255     if( !is_multisite() ) {
     255
     256    if ( !is_multisite() )
    256257        $level_key = $wpdb->get_blog_prefix() . 'user_level';
    257     } else {
     258    else
    258259        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
    259     }
    260260
    261261    $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
     
    303303    global $wpdb;
    304304
    305     if ( !is_multisite() ) {
     305    if ( !is_multisite() )
    306306        $level_key = $wpdb->get_blog_prefix() . 'user_level';
    307     } else {
     307    else
    308308        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
    309     }
    310309
    311310    return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
     
    333332    $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
    334333
    335     if( !$editable ) {
     334    if ( !$editable ) {
    336335        $other_unpubs = '';
    337336    } else {
     
    676675
    677676        $this->query_from_where = "FROM $wpdb->users";
    678         if ( $this->role )
     677        if ( $this->role ) {
    679678            $this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
    680         elseif ( !is_multisite() )
     679        } elseif ( !is_multisite() ) {
    681680            $this->query_from_where .= " WHERE 1=1";
    682         else {
     681        } else {
    683682            $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
    684683            $this->query_from_where .= ", $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
Note: See TracChangeset for help on using the changeset viewer.