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
This commit is contained in:
Joe McGill
2025-03-03 17:22:25 +00:00
parent f2de6c15ca
commit 59bb042094
2 changed files with 8 additions and 2 deletions

View File

@@ -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' );

View File

@@ -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.