diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
commit | 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch) | |
tree | 39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-admin/site-editor.php | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip |
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-admin/site-editor.php')
-rw-r--r-- | wp-admin/site-editor.php | 17 |
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. |