Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@melek 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