Changeset 57543
- Timestamp:
- 02/06/2024 07:40:21 PM (14 months ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/menu.php
r57159 r57543 206 206 if ( wp_is_block_theme() ) { 207 207 $submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' ); 208 } else { 209 $submenu['themes.php'][6] = array( __( 'Patterns', 'site editor menu item' ), 'edit_theme_options', 'edit.php?post_type=wp_block' ); 208 210 } 209 211 210 212 if ( ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ) { 211 $submenu['themes.php'][ 6] = array(213 $submenu['themes.php'][7] = array( 212 214 __( 'Template Parts' ), 213 215 'edit_theme_options', … … 221 223 // is using 'customize_register' to add a setting. 222 224 if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) { 223 $position = ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) ? 7 : 6;225 $position = ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ? 8 : 7; 224 226 225 227 $submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); -
trunk/src/wp-admin/site-editor.php
r56570 r57543 20 20 } 21 21 22 if ( ! ( current_theme_supports( 'block-template-parts' ) || wp_is_block_theme() ) ) {23 wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) );24 }25 26 22 $is_template_part = isset( $_GET['postType'] ) && 'wp_template_part' === sanitize_key( $_GET['postType'] ); 27 23 $is_template_part_path = isset( $_GET['path'] ) && 'wp_template_partall' === sanitize_key( $_GET['path'] ); 28 24 $is_template_part_editor = $is_template_part || $is_template_part_path; 25 $is_patterns = isset( $_GET['postType'] ) && 'wp_block' === sanitize_key( $_GET['postType'] ); 26 $is_patterns_path = isset( $_GET['path'] ) && 'patterns' === sanitize_key( $_GET['path'] ); 27 $is_patterns_editor = $is_patterns || $is_patterns_path; 29 28 30 if ( ! wp_is_block_theme() && ! $is_template_part_editor ) { 31 wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) ); 29 if ( ! wp_is_block_theme() ) { 30 if ( ! current_theme_supports( 'block-template-parts' ) && $is_template_part_editor ) { 31 wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) ); 32 } elseif ( ! $is_patterns_editor && ! $is_template_part_editor ) { 33 wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) ); 34 } 32 35 } 33 36 -
trunk/src/wp-includes/functions.php
r57532 r57543 5396 5396 $submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); 5397 5397 } else { 5398 $submenu['themes.php'][ 7] = array( $menu_name, 'edit_theme_options', 'widgets.php' );5398 $submenu['themes.php'][8] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); 5399 5399 } 5400 5400
Note: See TracChangeset
for help on using the changeset viewer.