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.

<?php
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" />';
	}
}
?>

So if you’ve selected the gray color scheme in your profile, you’ll see blue in the Network Admin, and vice versa.

Just put this script in your mu-plugins folder.

This has only been tested in the 3.1 beta.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: