WordPress.org

Make WordPress Core

Changeset 16370


Ignore:
Timestamp:
11/14/10 18:19:07 (3 years ago)
Author:
ryan
Message:

Handle sites that hard-code roles rather than storing them in the DB. Temp hack. see #15411

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/site-users.php

    r16272 r16370  
    135135    echo "<tr><th>" . __( 'User' ) . "</th><th>" . __( 'Role' ) . "</th><th>" . __( 'Password' ) . "</th><th>" . __( 'Remove' ) . "</th></tr>"; 
    136136    $user_count = 0; 
    137     $blog_prefix = $wpdb->get_blog_prefix( $id ); 
    138     $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); 
     137    // @todo This is a hack. Eventually, add API to WP_Roles allowing retrieval of roles for a particular blog. 
     138    if ( ! empty($wp_roles->use_db) ) { 
     139        // If using the DB to store roles, consult the user_roles option. 
     140        $blog_prefix = $wpdb->get_blog_prefix( $id ); 
     141        $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); 
     142    } else { 
     143        // Roles are stored in memory, not the DB. 
     144        $editblog_roles = $wp_roles->roles; 
     145    } 
    139146 
    140147    foreach ( $blogusers as $user_id => $user_object ) { 
Note: See TracChangeset for help on using the changeset viewer.