Skip to content

Instantly share code, notes, and snippets.

@tillkruss
Last active August 23, 2021 20:17
Show Gist options
  • Save tillkruss/6401453 to your computer and use it in GitHub Desktop.
Save tillkruss/6401453 to your computer and use it in GitHub Desktop.
Change the default MP6 admin color scheme.
<?php
add_filter( 'get_user_option_admin_color', function( $color_scheme ) {
global $_wp_admin_css_colors;
if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {
$color_scheme = 'ectoplasm';
}
return $color_scheme;
}, 5 );
@ms-studio
Copy link

I'm under the impression that this method doesn't work anymore in WP 3.8, as new users will have their $color_scheme already defined as "fresh" (both in wp_color_scheme_settings(), and in user.php, line 1384).

@andrewsfreeman has created a fork: https://gist.github.com/andrewsfreeman/8062263
but since he's testing against "fresh", this won't allow users to select the "fresh" scheme, if they would prefer that.

Any better idea ?

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