From 2b85a1b68bd1651929a7c9486ecd4c7b8e295213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Fri, 23 Jan 2026 11:04:47 +0100 Subject: [PATCH 1/4] Admin: Change default admin color scheme to 'modern'. Updates the default admin color scheme from 'fresh' to 'modern' for WordPress 7.0. - Bumps database version to trigger upgrade routine. - Adds upgrade_700() to migrate existing users with 'fresh' to 'modern'. - Updates default in wp_insert_user() for new users. - Updates fallback in admin_color_scheme_picker(). props: karmatosed --- src/wp-admin/includes/misc.php | 2 +- src/wp-admin/includes/upgrade.php | 26 ++++++++++++++++++++++++++ src/wp-includes/user.php | 6 +++--- src/wp-includes/version.php | 2 +- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php index 6c00a0ffb1951..6f6b1e2511fda 100644 --- a/src/wp-admin/includes/misc.php +++ b/src/wp-admin/includes/misc.php @@ -1018,7 +1018,7 @@ function admin_color_scheme_picker( $user_id ) { $current_color = get_user_option( 'admin_color', $user_id ); if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) { - $current_color = 'fresh'; + $current_color = 'modern'; } ?>
diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 04b7016b83bc9..52698a647281a 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -886,6 +886,10 @@ function upgrade_all() { upgrade_682(); } + if ( $wp_current_db_version < 60718 ) { + upgrade_700(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -2481,6 +2485,28 @@ function ( $url ) { } } +/** + * Executes changes made in WordPress 7.0. + * + * @ignore + * @since 7.0.0 + * + * @global wpdb $wpdb WordPress database abstraction object. + */ +function upgrade_700() { + global $wpdb; + + // Migrate users with 'fresh' admin color to 'modern'. + $wpdb->query( + $wpdb->prepare( + "UPDATE $wpdb->usermeta SET meta_value = %s WHERE meta_key = %s AND meta_value = %s", + 'modern', + 'admin_color', + 'fresh' + ) + ); +} + /** * Executes network-level upgrade routines. * diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 7885efe531b49..545329d8d776d 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -2184,7 +2184,7 @@ function validate_username( $username ) { * @type string $comment_shortcuts Whether to enable comment moderation keyboard * shortcuts for the user. Accepts 'true' or 'false' * as a string literal, not boolean. Default 'false'. - * @type string $admin_color Admin color scheme for the user. Default 'fresh'. + * @type string $admin_color Admin color scheme for the user. Default 'modern'. * @type bool $use_ssl Whether the user should always access the admin over * https. Default false. * @type string $user_registered Date the user registered in UTC. Format is 'Y-m-d H:i:s'. @@ -2457,7 +2457,7 @@ function wp_insert_user( $userdata ) { $meta['comment_shortcuts'] = empty( $userdata['comment_shortcuts'] ) || 'false' === $userdata['comment_shortcuts'] ? 'false' : 'true'; - $admin_color = empty( $userdata['admin_color'] ) ? 'fresh' : $userdata['admin_color']; + $admin_color = empty( $userdata['admin_color'] ) ? 'modern' : $userdata['admin_color']; $meta['admin_color'] = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $admin_color ); $meta['use_ssl'] = empty( $userdata['use_ssl'] ) ? '0' : '1'; @@ -2546,7 +2546,7 @@ function wp_insert_user( $userdata ) { * @type string $rich_editing Whether to enable the rich-editor for the user. Default 'true'. * @type string $syntax_highlighting Whether to enable the rich code editor for the user. Default 'true'. * @type string $comment_shortcuts Whether to enable keyboard shortcuts for the user. Default 'false'. - * @type string $admin_color The color scheme for a user's admin screen. Default 'fresh'. + * @type string $admin_color The color scheme for a user's admin screen. Default 'modern'. * @type int|bool $use_ssl Whether to force SSL on the user's admin area. 0|false if SSL * is not forced. * @type string $show_admin_bar_front Whether to show the admin bar on the front end for the user. diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index f1d2d950ab737..74a772b2163f3 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -23,7 +23,7 @@ * * @global int $wp_db_version */ -$wp_db_version = 60717; +$wp_db_version = 60718; /** * Holds the TinyMCE version. From 5c1f47a8cd999003db053df2060a49b312566881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Fri, 23 Jan 2026 22:03:39 +0100 Subject: [PATCH 2/4] Admin: Rename 'Default' admin color scheme to 'Classic'. --- src/wp-admin/admin-header.php | 2 +- src/wp-admin/customize.php | 2 +- src/wp-admin/includes/user.php | 2 +- src/wp-includes/general-template.php | 2 +- src/wp-includes/script-loader.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php index 0c075d68272a0..e1e9ba0f6562b 100644 --- a/src/wp-admin/admin-header.php +++ b/src/wp-admin/admin-header.php @@ -193,7 +193,7 @@ $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', (float) get_bloginfo( 'version' ) ); $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) ); -$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); +$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'modern' ); $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); if ( wp_is_mobile() ) { diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php index 1f1a9d38b1a9e..2065e55ffb3ce 100644 --- a/src/wp-admin/customize.php +++ b/src/wp-admin/customize.php @@ -148,7 +148,7 @@ } $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); $admin_color = get_user_option( 'admin_color' ); -$body_class .= ' admin-color-' . sanitize_html_class( is_string( $admin_color ) ? $admin_color : '', 'fresh' ); +$body_class .= ' admin-color-' . sanitize_html_class( is_string( $admin_color ) ? $admin_color : '', 'modern' ); if ( wp_use_widgets_block_editor() ) { $body_class .= ' wp-embed-responsive'; diff --git a/src/wp-admin/includes/user.php b/src/wp-admin/includes/user.php index fed01c36b26eb..0406b1ed268e1 100644 --- a/src/wp-admin/includes/user.php +++ b/src/wp-admin/includes/user.php @@ -134,7 +134,7 @@ function edit_user( $user_id = 0 ) { if ( $update ) { $user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' === $_POST['rich_editing'] ? 'false' : 'true'; $user->syntax_highlighting = isset( $_POST['syntax_highlighting'] ) && 'false' === $_POST['syntax_highlighting'] ? 'false' : 'true'; - $user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh'; + $user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'modern'; $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false'; } diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index f5dacf28f7327..550b7b2f5c281 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -4885,7 +4885,7 @@ function register_admin_color_schemes() { wp_admin_css_color( 'fresh', - _x( 'Default', 'admin color scheme' ), + _x( 'Classic', 'admin color scheme' ), false, array( '#1d2327', '#2c3338', '#2271b1', '#72aee6' ), array( diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 9507bb61ebe87..38bea91357818 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -2097,7 +2097,7 @@ function wp_style_loader_src( $src, $handle ) { $color = get_user_option( 'admin_color' ); if ( empty( $color ) || ! isset( $_wp_admin_css_colors[ $color ] ) ) { - $color = 'fresh'; + $color = 'modern'; } $color = $_wp_admin_css_colors[ $color ] ?? null; From 7ccdb5c17c6e20e3f6c9891cbb65abcd9a4c25a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Wed, 4 Feb 2026 12:29:26 +0100 Subject: [PATCH 3/4] Admin: Guard color scheme migration with version check. Wrap the 'fresh' to 'modern' admin color migration in a database version check to prevent re-running on subsequent version bumps during the release cycle. Also refactors to use `$wpdb->update()` for cleaner code. Props peterwilsoncc. --- src/wp-admin/includes/upgrade.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 52698a647281a..712bd51dc88f9 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -2491,20 +2491,23 @@ function ( $url ) { * @ignore * @since 7.0.0 * - * @global wpdb $wpdb WordPress database abstraction object. + * @global int $wp_current_db_version The old (current) database version. + * @global wpdb $wpdb WordPress database abstraction object. */ function upgrade_700() { - global $wpdb; + global $wp_current_db_version, $wpdb; // Migrate users with 'fresh' admin color to 'modern'. - $wpdb->query( - $wpdb->prepare( - "UPDATE $wpdb->usermeta SET meta_value = %s WHERE meta_key = %s AND meta_value = %s", - 'modern', - 'admin_color', - 'fresh' - ) - ); + if ( $wp_current_db_version < 60718 ) { + $wpdb->update( + $wpdb->usermeta, + array( 'meta_value' => 'modern' ), + array( + 'meta_key' => 'admin_color', + 'meta_value' => 'fresh', + ) + ); + } } /** From 172ab0cb749587b92c020355d3605bc81e5568f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Wed, 4 Feb 2026 12:32:51 +0100 Subject: [PATCH 4/4] Admin: Reorder color schemes to place Modern first. Moves the Modern color scheme (the new default) to the first position in the Administration Color Scheme picker on the profile page. Classic and Light follow immediately after, making it easy for users to find and return to familiar schemes after trying other options. Props peterwilsoncc. --- src/wp-admin/includes/misc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php index 6f6b1e2511fda..7cbb1942f5bda 100644 --- a/src/wp-admin/includes/misc.php +++ b/src/wp-admin/includes/misc.php @@ -1001,14 +1001,14 @@ function admin_color_scheme_picker( $user_id ) { ksort( $_wp_admin_css_colors ); - if ( isset( $_wp_admin_css_colors['fresh'] ) ) { - // Set Default ('fresh') and Light should go first. + if ( isset( $_wp_admin_css_colors['modern'] ) ) { + // Set Modern (new default), Classic ('fresh'), and Light first. $_wp_admin_css_colors = array_filter( array_merge( array( + 'modern' => '', 'fresh' => '', 'light' => '', - 'modern' => '', ), $_wp_admin_css_colors )