Skip to content

Commit

Permalink
Editor: Remove missing postType and postId query args Site Editor red…
Browse files Browse the repository at this point in the history
…irect.

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:
* [WordPress/gutenberg#48023 Gutenberg PR 48023]
* [WordPress/gutenberg#47777 Gutenberg PR 47777]

Follow-up to [55333], [53413], [53093].

Props ntsekouras, youknowriad.
Fixes #57716.
Built from https://develop.svn.wordpress.org/trunk@55338


git-svn-id: http://core.svn.wordpress.org/trunk@54871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
hellofromtonya committed Feb 14, 2023
1 parent fb6c959 commit ab35789
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions wp-admin/site-editor.php
Expand Up @@ -28,23 +28,6 @@
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';
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2-beta1-55337';
$wp_version = '6.2-beta1-55338';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit ab35789

Please sign in to comment.