Skip to content

Commit 49a4a72

Browse files
committed
Editor: Expose the Site Editor Patterns page for classic themes.
The Site Editor Patterns page was exposed internally for the Classic theme as of WP6.5. As we aim to officially expose the new Patterns page as of WP6.6, this changeset makes the following changes available when a classic themes is activated: - Link Appearance > Patterns submenu to the Site Editor Patterns page located at `wp-admin/site-editor.php?path=/patterns - Remove Template Parts submenu Props wildworks, audrasjb, ironprogrammer, azaozz, youknowriad. Fixes #61109. git-svn-id: https://develop.svn.wordpress.org/trunk@58278 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 802f924 commit 49a4a72

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

src/wp-admin/menu.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,25 +206,15 @@
206206
if ( wp_is_block_theme() ) {
207207
$submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' );
208208
} else {
209-
$submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'edit.php?post_type=wp_block' );
210-
}
211-
212-
if ( ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ) {
213-
$submenu['themes.php'][7] = array(
214-
__( 'Template Parts' ),
215-
'edit_theme_options',
216-
'site-editor.php?path=/wp_template_part/all',
217-
);
209+
$submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?path=/patterns' );
218210
}
219211

220212
$customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
221213

222214
// Hide Customize link on block themes unless a plugin or theme
223215
// is using 'customize_register' to add a setting.
224216
if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) {
225-
$position = ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ? 8 : 7;
226-
227-
$submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
217+
$submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
228218
}
229219

230220
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {

src/wp-includes/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5400,7 +5400,7 @@ function wp_widgets_add_menu() {
54005400
}
54015401

54025402
$menu_name = __( 'Widgets' );
5403-
if ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) {
5403+
if ( wp_is_block_theme() ) {
54045404
$submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
54055405
} else {
54065406
$submenu['themes.php'][8] = array( $menu_name, 'edit_theme_options', 'widgets.php' );

0 commit comments

Comments
 (0)