Swap Color Schemes When Switching Between Network and Site Admins

I wanted to find a way to make it just a little bit more obvious when I switched between the network and site admins. But I didn’t want to have to do a lot of actual customizing. So using built in styles, I found I could just swap the color schemes.

add_action( 'admin_print_styles', 'admin_color_swap', 99 );
function admin_color_swap() {
    if ( is_network_admin() ) {
        global $current_user;
        get_currentuserinfo();
        $selected = $current_user->admin_color;
        $swapped = array( 'fresh' => 'classic', 'classic' => 'fresh' );
        $new = $swapped[$selected];        
        echo '<link rel="stylesheet" type="text/css" href="/wp-admin/css/colors-'.$new.'.css" />';
    }
}

Swap Color Schemes When in the Network Admin

In WordPress 3.1, the network-wide options being moved to their own area in WordPress to make it easier on network administrators.

To take a just a bit further, I put together this script that will switch color schemes when you’re in the Network Admin.

Continue reading Swap Color Schemes When in the Network Admin