From 81feb44d53d977796f5bdfd64f5fab1a0c2b451f Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Tue, 14 Feb 2023 16:24:11 +0000 Subject: [PATCH] Editor: Remove missing postType and postId query args Site Editor redirect. Removes the server-side redirection if missing `postType` and `postId` query args when visiting Site Editor. Why? This redirect is no longer needed as the routing is now handled client side (via [55333]). References: * [https://github.com/WordPress/gutenberg/pull/48023 Gutenberg PR 48023] * [https://github.com/WordPress/gutenberg/pull/47777 Gutenberg PR 47777] Follow-up to [55333], [53413], [53093]. Props ntsekouras, youknowriad. Fixes #57716. git-svn-id: https://develop.svn.wordpress.org/trunk@55338 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/site-editor.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/wp-admin/site-editor.php b/src/wp-admin/site-editor.php index 23d44d7ea2..dd5211dc0b 100644 --- a/src/wp-admin/site-editor.php +++ b/src/wp-admin/site-editor.php @@ -28,23 +28,6 @@ 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. - */ -$home_template = _resolve_home_block_template(); -if ( $home_template && empty( $_GET['postType'] ) && empty( $_GET['postId'] ) ) { - if ( ! empty( $_GET['styles'] ) ) { - $home_template['styles'] = sanitize_key( $_GET['styles'] ); - } - $redirect_url = add_query_arg( - $home_template, - admin_url( 'site-editor.php' ) - ); - wp_safe_redirect( $redirect_url ); - exit; -} - // Used in the HTML title tag. $title = _x( 'Editor', 'site editor title tag' ); $parent_file = 'themes.php';