I am surprised with the new colour scheme for 3.8 and although the classic 3.7 theme has gone, I would like to set the new “Light” colour scheme as the default for all users, but at the same time, still allow them to change the theme if they wish, in their user profile.
Has anyone managed to come up with a function to set the default for all users? I’ve searched but can find nothing as this is so new, 3.8 codex not fully written.
You can set (in terms of force) a default color within
functions.php
like this:Update: The following color schemes are available per default at WP 3.8
Bonus (found on wpmudev): Disable the Admin Color Scheme Options to make sure that users can not switch back to another color:
Update 2: As Rarst pointed out the filter above will force a specific color scheme instead of setting a changeable default. The solution to this is to run an action only once (e.g. on user setup/registration) so after that the user can decide and change the color on his own:
Update 3: Okay, so one more try 🙂
The idea is to add extra user meta data (see
custom_admin_color_scheme
) as soon as the user updates the profile; as long as the field is not set totrue
we’ll change the default admin color scheme to a color scheme of our choice:Update 4: Finally there is also a very nice plugin on wordpress.org to handle default admin color schemes easily: Default Admin Color Scheme
the
add_filter( 'get_user_option_admin_color', ...)
sets the color, but it doesn’t remove the option from my-profile page. So, if you want to enforce (and block) any modification by user:If you also need to set that when user registers, then :