From 0b6bc9a386aa1a4c9b64818505e7657936367ff0 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Thu, 19 May 2022 02:25:09 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@53413 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/site-editor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-admin/site-editor.php b/src/wp-admin/site-editor.php index 9fac7e62c7..86f140cde3 100644 --- a/src/wp-admin/site-editor.php +++ b/src/wp-admin/site-editor.php @@ -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' )