Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
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 authored and ockham committed Sep 15, 2022
commit cfa8c586c5e5e7ea0df5ccb35c193c268d056f5b
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