Make WordPress Core

Ticket #37434: 37434.patch

File 37434.patch, 1.2 KB (added by jignesh.nakrani, 10 years ago)
  • wp-admin/admin-header.php

    diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
    index 17dc162..d1329be 100644
    a b if ( ! defined( 'WP_ADMIN' ) ) 
    2222 * @global string    $update_title
    2323 * @global int       $total_update_count
    2424 * @global string    $parent_file
     25 * @global WP_User   $current_user
    2526 */
    2627global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
    27         $update_title, $total_update_count, $parent_file;
     28        $update_title, $total_update_count, $parent_file, $current_user;
    2829
    2930// Catch plugins that include admin-header.php before admin.php completes.
    3031if ( empty( $current_screen ) )
    $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0- 
    159160$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
    160161$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
    161162
     163$user_roles = $current_user->roles;
     164$user_role = array_shift($user_roles);
     165$admin_body_class .= ' wp-role-' . $user_role;
     166
    162167if ( wp_is_mobile() )
    163168        $admin_body_class .= ' mobile';
    164169