From af57e9cf20ed76008d7f63fd4a36e79497d59199 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 24 Jul 2023 16:56:36 +0400 Subject: [PATCH 1/2] Template Editing Mode: Fix checks in 'site-editor.php' --- src/wp-admin/site-editor.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/site-editor.php b/src/wp-admin/site-editor.php index 6c4efd2a50c2b..93b1a9313135f 100644 --- a/src/wp-admin/site-editor.php +++ b/src/wp-admin/site-editor.php @@ -23,7 +23,10 @@ wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) ); } -$is_template_part_editor = isset( $_GET['postType'] ) && 'wp_template_part' === sanitize_key( $_GET['postType'] ); +$is_template_part = isset( $_GET['postType'] ) && 'wp_template_part' === sanitize_key( $_GET['postType'] ); +$is_template_part_path = isset( $_GET['path'] ) && 'wp_template_partall' === sanitize_key( $_GET['path'] ); +$is_template_part_editor = $is_template_part || $is_template_part_path; + if ( ! wp_is_block_theme() && ! $is_template_part_editor ) { wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) ); } From af5a7288feb78419bb926922a1a3a8580138aaa5 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 24 Jul 2023 18:16:15 +0400 Subject: [PATCH 2/2] Update menu link --- src/wp-admin/menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php index 75e3d7e065303..17317f9daa24b 100644 --- a/src/wp-admin/menu.php +++ b/src/wp-admin/menu.php @@ -210,7 +210,7 @@ $submenu['themes.php'][6] = array( __( 'Template Parts' ), 'edit_theme_options', - 'site-editor.php?postType=wp_template_part&path=/wp_template_part/all', + 'site-editor.php?path=/wp_template_part/all', ); }