Set One Admin Color Scheme for Everyone
Applies the same admin color scheme to all users and hides the color picker on the profile screen. Handy for telling staging and production apart.
Opens WPIDE on
Code
add_filter( 'get_user_option_admin_color', function () {
// Built-in schemes: fresh, light, modern, blue, coffee, ectoplasm, midnight, ocean, sunrise.
return 'modern';
} );
add_action( 'admin_init', function () {
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
} );
Notes
Change modern to any built-in scheme name.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.