I need to change default color scheme for all users.
The admin bar on my site is vidibile for all users including guests.
The default black color scheme isn’t beauty with my design and I would like to change it with cofee scheme. Is there any way to do this?
I already found
add_filter('get_user_option_admin_color','change_admin_color');
function change_admin_color($result) {
return 'coffee';
}
But it disable feature to choose another color scheme for users.
And first of all it work only for logged in users.
At the moment (3.8) color schemes do not apply to admin bar at front end at all, even if user is logged in and has non-default scheme selected.
The shortest way would probably be to force enqueue color scheme at front end:
Note that core chose not to do it, so it is untested and there is risk of style incompatibilities and such.
You can setup a theme on profile update, and if it present return that from the function hooking
get_user_option_admin_color
otherwise return the default:Code require PHP 5.3. Untested.
https://wordpress.org/plugins/admin-bar-color/ works, is light-weight, well written and on GitHub.
I had to re-save my profile once, but now my frontend admin bar color matches
/wp-admin/
.