Skip to content

Instantly share code, notes, and snippets.

@tillkruss
Last active March 5, 2023 02:41
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save tillkruss/7955444 to your computer and use it in GitHub Desktop.
Save tillkruss/7955444 to your computer and use it in GitHub Desktop.
Enforce a specific WordPress admin color scheme.
<?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';
});
});
@melek
Copy link

melek commented Dec 20, 2018

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() ) { ... }.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment