Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save arenagroove/c3927ff6bcd817a78075c2d3d2457cf1 to your computer and use it in GitHub Desktop.

Select an option

Save arenagroove/c3927ff6bcd817a78075c2d3d2457cf1 to your computer and use it in GitHub Desktop.
WordPress 7.0 Admin Color Scheme Fix
<?php
/**
* Plugin Name: WP 7.0 Admin Color Scheme Fix
* Description: Restores Fresh as default admin color scheme; removes "Modern" option (new default); Restores contrast on notices.
*/
defined( 'ABSPATH' ) || exit;
add_filter( 'get_user_option_admin_color', function( $color, $option, $user ) {
if ( empty( $color ) || 'modern' === $color ) {
return 'fresh';
}
return $color;
}, 20, 3 );
add_action( 'admin_init', function() {
global $_wp_admin_css_colors;
if ( isset( $_wp_admin_css_colors['modern'] ) ) {
unset( $_wp_admin_css_colors['modern'] );
}
} );
add_action( 'admin_head', function() {
?>
<style>
.notice,div.error,div.updated {
background: #fff;
border-block: 1px solid #c3c4c7;
border-right: 1px solid #c3c4c7;
box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
</style>
<?php
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment