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.



Built from https://develop.svn.wordpress.org/trunk@58278


git-svn-id: http://core.svn.wordpress.org/trunk@57738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2024-06-02 08:17:17 +00:00
parent cd1ba19e52
commit a0ba76dec8
3 changed files with 4 additions and 14 deletions

View File

@ -206,15 +206,7 @@ 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', 'edit.php?post_type=wp_block' );
}
if ( ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ) {
$submenu['themes.php'][7] = array(
__( 'Template Parts' ),
'edit_theme_options',
'site-editor.php?path=/wp_template_part/all',
);
$submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?path=/patterns' );
}
$customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
@ -222,9 +214,7 @@ $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_remova
// Hide Customize link on block themes unless a plugin or theme
// is using 'customize_register' to add a setting.
if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) {
$position = ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ? 8 : 7;
$submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
$submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
}
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {

View File

@ -5400,7 +5400,7 @@ function wp_widgets_add_menu() {
}
$menu_name = __( 'Widgets' );
if ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) {
if ( wp_is_block_theme() ) {
$submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
} else {
$submenu['themes.php'][8] = array( $menu_name, 'edit_theme_options', 'widgets.php' );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-58277';
$wp_version = '6.6-alpha-58278';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.