summaryrefslogtreecommitdiffstats
path: root/wp-admin/site-editor.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
commitfa9a33d818470a5796f0ff8797f98b510ed8de18 (patch)
treebde6a1eede376f9b5df5898ce812330152984d8e /wp-admin/site-editor.php
parentReleasing progress-linux version 6.4.3+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.tar.xz
wordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.zip
Merging upstream version 6.5+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--wp-admin/site-editor.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/wp-admin/site-editor.php b/wp-admin/site-editor.php
index 6442ee5..70d646a 100644
--- a/wp-admin/site-editor.php
+++ b/wp-admin/site-editor.php
@@ -19,16 +19,19 @@ if ( ! current_user_can( 'edit_theme_options' ) ) {
);
}
-if ( ! ( current_theme_supports( 'block-template-parts' ) || wp_is_block_theme() ) ) {
- wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) );
-}
-
$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.' ) );
+$is_patterns = isset( $_GET['postType'] ) && 'wp_block' === sanitize_key( $_GET['postType'] );
+$is_patterns_path = isset( $_GET['path'] ) && 'patterns' === sanitize_key( $_GET['path'] );
+$is_patterns_editor = $is_patterns || $is_patterns_path;
+
+if ( ! wp_is_block_theme() ) {
+ if ( ! current_theme_supports( 'block-template-parts' ) && $is_template_part_editor ) {
+ wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) );
+ } elseif ( ! $is_patterns_editor && ! $is_template_part_editor ) {
+ wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) );
+ }
}
// Used in the HTML title tag.