diff --git a/src/wp-admin/site-editor.php b/src/wp-admin/site-editor.php
index 7e2e763dee..8c98b8fc44 100644
a
|
b
|
$custom_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pa |
73 | 73 | |
74 | 74 | $editor_settings = get_block_editor_settings( $custom_settings, $block_editor_context ); |
75 | 75 | |
76 | | if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) { |
| 76 | if ( isset( $_GET['postType'] ) && isset( $_GET['postId'] ) ) { |
77 | 77 | $post_type = get_post_type_object( $_GET['postType'] ); |
78 | 78 | if ( ! $post_type ) { |
79 | | wp_die( __( 'Invalid post type.' ) ); |
| 79 | wp_die( |
| 80 | __( 'Invalid post type.' ), |
| 81 | __( '404 Not Found' ), |
| 82 | array( |
| 83 | 'link_url' => admin_url( 'site-editor.php' ), |
| 84 | 'link_text' => __( 'Return to site editor' ), |
| 85 | ) |
| 86 | ); |
| 87 | } |
| 88 | $post_object = get_post( $_GET['postId'] ); |
| 89 | if ( ! $post_object || $post_object->post_type !== $post_type->name ) { |
| 90 | wp_die( |
| 91 | __( 'Invalid page ID.' ), |
| 92 | __( '404 Not Found' ), |
| 93 | array( |
| 94 | 'link_url' => admin_url( 'site-editor.php' ), |
| 95 | 'link_text' => __( 'Return to site editor' ), |
| 96 | ) |
| 97 | ); |
80 | 98 | } |
81 | 99 | } |
82 | 100 | |