Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix prevent unwanted access of site-editor.php
non block themes that support block based template parts should only be allowed to access the site-editor.php file if the query parameter to access the template part editor is set correctly
  • Loading branch information
fabiankaegy committed Sep 14, 2022
commit ecd664ab1e44800681333a32e6962ec52c9e9ae7
5 changes: 5 additions & 0 deletions src/wp-admin/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
wp_die( __( 'The theme you are currently using is not compatible with Full Site Editing.' ) );
}

$is_template_part_editor = isset( $_GET['postType'] ) && 'wp_template_part' === sanitize_key( $_GET['postType'] );
if ( ! wp_is_block_theme() && ! $is_template_part_editor ) {
wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) );
}

/**
* Do a server-side redirection if missing `postType` and `postId`
* query args when visiting Site Editor.
Expand Down