diff --git a/src/wp-admin/site-editor.php b/src/wp-admin/site-editor.php index 71d289be7a02f..5a017dc722d6a 100644 --- a/src/wp-admin/site-editor.php +++ b/src/wp-admin/site-editor.php @@ -59,7 +59,10 @@ static function ( $classes ) { $context_settings = array( 'name' => 'core/edit-site' ); if ( ! empty( $_GET['postId'] ) ) { - $context_settings['post'] = get_post( $_GET['postId'] ); + $post_id = (int) $_GET['postId']; + if ( $post_id ) { + $context_settings['post'] = get_post( $post_id ); + } } $block_editor_context = new WP_Block_Editor_Context( $context_settings );