Make WordPress Core

Changeset 61644


Ignore:
Timestamp:
02/15/2026 08:01:50 AM (6 weeks ago)
Author:
fabiankaegy
Message:

Admin: Change the default admin color scheme to Modern.

Rename the 'Modern' color scheme to 'Default' and the previous 'Default' scheme to 'Fresh'. Update all fallback references from 'fresh' to 'modern' across admin headers, the Customizer, the color scheme picker, the script loader, and user functions.

Add an upgrade routine in upgrade_700() to migrate existing users with the 'fresh' admin color to 'modern'.

Props fabiankaegy, audrasjb, mukesh27, westonruter, peterwilsoncc, jorbin, sabernhardt, joedolson, phpbits.
Fixes #64546.

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin-header.php

    r61440 r61644  
    194194$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', (float) get_bloginfo( 'version' ) );
    195195$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) );
    196 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
     196$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'modern' );
    197197$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
    198198
  • trunk/src/wp-admin/customize.php

    r61440 r61644  
    149149$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
    150150$admin_color = get_user_option( 'admin_color' );
    151 $body_class .= ' admin-color-' . sanitize_html_class( is_string( $admin_color ) ? $admin_color : '', 'fresh' );
     151$body_class .= ' admin-color-' . sanitize_html_class( is_string( $admin_color ) ? $admin_color : '', 'modern' );
    152152
    153153if ( wp_use_widgets_block_editor() ) {
  • trunk/src/wp-admin/includes/misc.php

    r61594 r61644  
    10051005    ksort( $_wp_admin_css_colors );
    10061006
    1007     if ( isset( $_wp_admin_css_colors['fresh'] ) ) {
    1008         // Set Default ('fresh') and Light should go first.
     1007    if ( isset( $_wp_admin_css_colors['modern'] ) ) {
     1008        // Set Modern (new default), Classic ('fresh'), and Light first.
    10091009        $_wp_admin_css_colors = array_filter(
    10101010            array_merge(
    10111011                array(
     1012                    'modern' => '',
    10121013                    'fresh'  => '',
    10131014                    'light'  => '',
    1014                     'modern' => '',
    10151015                ),
    10161016                $_wp_admin_css_colors
     
    10221022
    10231023    if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) {
    1024         $current_color = 'fresh';
     1024        $current_color = 'modern';
    10251025    }
    10261026    ?>
     
    10681068    // It's possible to have a color scheme set that is no longer registered.
    10691069    if ( empty( $_wp_admin_css_colors[ $color_scheme ] ) ) {
    1070         $color_scheme = 'fresh';
     1070        $color_scheme = 'modern';
    10711071    }
    10721072
    10731073    if ( ! empty( $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) {
    10741074        $icon_colors = $_wp_admin_css_colors[ $color_scheme ]->icon_colors;
    1075     } elseif ( ! empty( $_wp_admin_css_colors['fresh']->icon_colors ) ) {
    1076         $icon_colors = $_wp_admin_css_colors['fresh']->icon_colors;
     1075    } elseif ( ! empty( $_wp_admin_css_colors['modern']->icon_colors ) ) {
     1076        $icon_colors = $_wp_admin_css_colors['modern']->icon_colors;
    10771077    } else {
    10781078        // Fall back to the default set of icon colors if the default scheme is missing.
  • trunk/src/wp-admin/includes/upgrade.php

    r61270 r61644  
    887887    }
    888888
     889    if ( $wp_current_db_version < 61644 ) {
     890        upgrade_700();
     891    }
     892
    889893    maybe_disable_link_manager();
    890894
     
    24832487
    24842488/**
     2489 * Executes changes made in WordPress 7.0.
     2490 *
     2491 * @ignore
     2492 * @since 7.0.0
     2493 *
     2494 * @global int  $wp_current_db_version The old (current) database version.
     2495 * @global wpdb $wpdb                  WordPress database abstraction object.
     2496 */
     2497function upgrade_700() {
     2498    global $wp_current_db_version, $wpdb;
     2499
     2500    // Migrate users with 'fresh' admin color to 'modern'.
     2501    if ( $wp_current_db_version < 61644 ) {
     2502        $wpdb->update(
     2503            $wpdb->usermeta,
     2504            array( 'meta_value' => 'modern' ),
     2505            array(
     2506                'meta_key'   => 'admin_color',
     2507                'meta_value' => 'fresh',
     2508            )
     2509        );
     2510    }
     2511}
     2512
     2513/**
    24852514 * Executes network-level upgrade routines.
    24862515 *
  • trunk/src/wp-admin/includes/user.php

    r61538 r61644  
    135135        $user->rich_editing         = isset( $_POST['rich_editing'] ) && 'false' === $_POST['rich_editing'] ? 'false' : 'true';
    136136        $user->syntax_highlighting  = isset( $_POST['syntax_highlighting'] ) && 'false' === $_POST['syntax_highlighting'] ? 'false' : 'true';
    137         $user->admin_color          = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';
     137        $user->admin_color          = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'modern';
    138138        $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false';
    139139    }
  • trunk/src/wp-includes/general-template.php

    r61611 r61644  
    48934893
    48944894    wp_admin_css_color(
     4895        'modern',
     4896        _x( 'Default', 'admin color scheme' ),
     4897        admin_url( "css/colors/modern/colors$suffix.css" ),
     4898        array( '#1e1e1e', '#3858e9', '#7b90ff' ),
     4899        array(
     4900            'base'    => '#f3f1f1',
     4901            'focus'   => '#fff',
     4902            'current' => '#fff',
     4903        )
     4904    );
     4905
     4906    wp_admin_css_color(
    48954907        'fresh',
    4896         _x( 'Default', 'admin color scheme' ),
     4908        _x( 'Fresh', 'admin color scheme' ),
    48974909        false,
    48984910        array( '#1d2327', '#2c3338', '#2271b1', '#72aee6' ),
     
    49134925            'focus'   => '#ccc',
    49144926            'current' => '#ccc',
    4915         )
    4916     );
    4917 
    4918     wp_admin_css_color(
    4919         'modern',
    4920         _x( 'Modern', 'admin color scheme' ),
    4921         admin_url( "css/colors/modern/colors$suffix.css" ),
    4922         array( '#1e1e1e', '#3858e9', '#7b90ff' ),
    4923         array(
    4924             'base'    => '#f3f1f1',
    4925             'focus'   => '#fff',
    4926             'current' => '#fff',
    49274927        )
    49284928    );
  • trunk/src/wp-includes/script-loader.php

    r61611 r61644  
    21062106
    21072107        if ( empty( $color ) || ! isset( $_wp_admin_css_colors[ $color ] ) ) {
    2108             $color = 'fresh';
     2108            $color = 'modern';
    21092109        }
    21102110
  • trunk/src/wp-includes/user.php

    r61637 r61644  
    21852185 *                                        shortcuts for the user. Accepts 'true' or 'false'
    21862186 *                                        as a string literal, not boolean. Default 'false'.
    2187  *     @type string $admin_color          Admin color scheme for the user. Default 'fresh'.
     2187 *     @type string $admin_color          Admin color scheme for the user. Default 'modern'.
    21882188 *     @type bool   $use_ssl              Whether the user should always access the admin over
    21892189 *                                        https. Default false.
     
    24582458    $meta['comment_shortcuts'] = empty( $userdata['comment_shortcuts'] ) || 'false' === $userdata['comment_shortcuts'] ? 'false' : 'true';
    24592459
    2460     $admin_color         = empty( $userdata['admin_color'] ) ? 'fresh' : $userdata['admin_color'];
     2460    $admin_color         = empty( $userdata['admin_color'] ) ? 'modern' : $userdata['admin_color'];
    24612461    $meta['admin_color'] = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $admin_color );
    24622462
     
    25472547     *     @type string   $syntax_highlighting  Whether to enable the rich code editor for the user. Default 'true'.
    25482548     *     @type string   $comment_shortcuts    Whether to enable keyboard shortcuts for the user. Default 'false'.
    2549      *     @type string   $admin_color          The color scheme for a user's admin screen. Default 'fresh'.
     2549     *     @type string   $admin_color          The color scheme for a user's admin screen. Default 'modern'.
    25502550     *     @type int|bool $use_ssl              Whether to force SSL on the user's admin area. 0|false if SSL
    25512551     *                                          is not forced.
  • trunk/src/wp-includes/version.php

    r61459 r61644  
    2424 * @global int $wp_db_version
    2525 */
    26 $wp_db_version = 60717;
     26$wp_db_version = 61644;
    2727
    2828/**
Note: See TracChangeset for help on using the changeset viewer.