diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index e7815bafa4..641e87e462 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -134,8 +134,15 @@ if ( is_array( $blogusers ) ) { echo ''; echo ""; $user_count = 0; - $blog_prefix = $wpdb->get_blog_prefix( $id ); - $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); + // @todo This is a hack. Eventually, add API to WP_Roles allowing retrieval of roles for a particular blog. + if ( ! empty($wp_roles->use_db) ) { + // If using the DB to store roles, consult the user_roles option. + $blog_prefix = $wpdb->get_blog_prefix( $id ); + $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); + } else { + // Roles are stored in memory, not the DB. + $editblog_roles = $wp_roles->roles; + } foreach ( $blogusers as $user_id => $user_object ) { $user_count++;
" . __( 'User' ) . "" . __( 'Role' ) . "" . __( 'Password' ) . "" . __( 'Remove' ) . "