Last active
October 9, 2024 00:35
-
-
Save tillkruss/7955444 to your computer and use it in GitHub Desktop.
Enforce a specific WordPress admin color scheme.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_init', function() { | |
// remove the color scheme picker | |
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); | |
// force all users to use the "Ectoplasm" color scheme | |
add_filter( 'get_user_option_admin_color', function() { | |
return 'ectoplasm'; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! I found a good use for this to help us visually differentiate staging, develop, etc. environments by wrapping this in
if ( preg_match( '/staging/', home_url() ) { ... }
.