New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Editor: Preserve query params on initial redirect #2727
Conversation
src/wp-admin/site-editor.php
Outdated
@@ -30,7 +30,7 @@ | |||
$home_template = _resolve_home_block_template(); | |||
if ( $home_template && empty( $_GET['postType'] ) && empty( $_GET['postId'] ) ) { | |||
$redirect_url = add_query_arg( | |||
$home_template, | |||
array_merge( $home_template, $_GET ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with a general fix. But I can update this only to support the styles
query param.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simply support styles
for now and if a general fix is needed it can be done later.
With a general fix visiting http://wp-dev.local/wp/wp-admin/site-editor.php?styles=open&postType=
(I'm the worst, I know 😉) ended up with a white screen rather than the site editor.
I'll push to this branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @peterwilsoncc.
We can land general fix in the next major release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming that this fixes https://core.trac.wordpress.org/ticket/55752. Thanks!
I think the general fix is nice in case more params are added in the future, or plugins use params in some way to affect the editor.
PR fixes the issue when query parameters are removed on Site Editor homepage redirection.
Trac ticket: https://core.trac.wordpress.org/ticket/55752
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.