Site Editor: Include `style` parameter in home template redirect.

When redirecting the site editor to the home template include the `style` querystring parameter if it is set. This ensures the style panel opens if the user expects it.

Props grantmkin, mamaduka, peterwilsoncc.
Fixes #55752.


Built from https://develop.svn.wordpress.org/trunk@53413


git-svn-id: http://core.svn.wordpress.org/trunk@53002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2022-05-19 02:27:13 +00:00
parent 6d0b0d9a4b
commit 08c5dbc7e9
2 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,9 @@ if ( ! wp_is_block_theme() ) {
*/
$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' )

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53411';
$wp_version = '6.1-alpha-53413';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.