WordPress 3.8 Admin Colour Selection

WordPress 3.8 Colour Schemes

WordPress 3.8 brings a new styled administration backend. Making it responsive and with a selection of 6 colour schemes. The previous version only had two colors, blue or grey.

Users can easily select or change which colour scheme they want by going to their user profile and making the change.

Regular WordPress users can stop reading here, however if you are a WordPress developer looking for a way to set the default scheme to match your own branding or any other reason, please read on.

The default color scheme is black, grey, blue, but for our sites, we wanted our default scheme for new users to be ‘Midnight’, black, grey, blue red so we could differentiate the full back end from the colour scheme we use for the Easy Blogging Plugin (from WPMU DEV) that we provide on our sites.

To do this you need to set the user meta option when a new user is created.

Add the following bit of code to your functions.php (changing the scheme name as required)


add_action( 'user_register', function($userid) {
 update_user_option( $userid, 'admin_color', 'midnight');
 });

If you are doing this on a WordPress multi-site, there is an additional parameter required at the end of  the call to update_user_option  and you probably want to create a mini plugin or add it to other multi site code you already have in your own ‘plugin’

e.g.


<?php
/*
Plugin Name: do-special-stuff

Plugin URI: http://llocally.com
Description: Does extra stuff for my multisite
Version: 0.1
Author: llocally
Author URI: http://llocally.com
*/

/* ----   set default admin colour scheme for new users--- */

add_action( 'user_register', function($userid) {
 update_user_option( $userid, 'admin_color', 'midnight', true );
 });

/* --- end  admin colours --- *

?>

2 comments

  1. Thanks for the article. I can’t believe on WP 3.8 none of the colour options included the old colour scheme which people are used to and is far easier on the eye in my opinion. WP needs to learn if it ain’t broke don’t fix it!

Submit a comment:

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>