From 59bb042094c8e0d0cdac39467bad59bb867a56e4 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Mon, 3 Mar 2025 17:22:25 +0000 Subject: [PATCH] Editor: Support Stylebook in the Site Editor for classic themes. This modifies the submenu for the Site Editor which previously linked directly to the Patterns page after [58278] to support accessing the Stylebook in classic themes via a new "Design" link. Currently, any classic themes that have either added support for `editor-styles` or have a theme.json file will automatically see this new link in the admin menu. Props isabel_brison, poena, wildworks, mamaduka, karmatosed, joemcgill. Fixes #62509. Built from https://develop.svn.wordpress.org/trunk@59905 git-svn-id: http://core.svn.wordpress.org/trunk@59247 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu.php | 8 +++++++- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 81fdefb8bd..82136429ba 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -211,7 +211,13 @@ if ( ! is_multisite() && current_user_can( 'update_themes' ) ) { if ( wp_is_block_theme() ) { $submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' ); } else { - $submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?path=/patterns' ); + $supports_stylebook = ( current_theme_supports( 'editor-styles' ) || wp_theme_has_theme_json() ); + + if ( $supports_stylebook ) { + $submenu['themes.php'][6] = array( _x( 'Design', 'design menu item' ), 'edit_theme_options', 'site-editor.php' ); + } else { + $submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?p=/pattern' ); + } } $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index de97dde903..679d181968 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59904'; +$wp_version = '6.8-alpha-59905'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.