#32692 closed enhancement (fixed)
Remove removable query vars from certain redirect URLs
Reported by: | johnbillion | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | minor | Version: | 4.2 |
Component: | Administration | Keywords: | good-first-bug has-patch dev-feedback |
Focuses: | Cc: |
Description
Scenario:
- Edit a post and hit 'Update' or 'Publish'
- Navigate to Appearance -> Customize
- Do all the things
- Close the Customizer
Note that you are returned to the post editing screen, but the 'Post updated' message persists because the message
query var is still present.
#23367 introduced a list of removable query vars which get hidden from the page's URL once the page loads. This list of query vars should be abstracted into its own function so the list can be reused. It can then be used to remove these query vars from the redirect destination URL after closing the Customizer, and maybe also in other situations (logging in?).
My User Switching plugin already does this when switching between users, but it has to implement its own list of removable query vars.
Attachments (4)
Change History (14)
#2
@
9 years ago
add_query_arg
isn't the problem here.
First, the removable query vars inside wp_admin_canonical_url
should be moved to their own function (pretty easy). Then you need to use that function in wp-admin/customize.php
, just at the beginning where $return
is set.
I will try to create a patch for that at the WordCamp Europe Contributor Day on Sunday.
#3
@
9 years ago
I've changed wp_admin_canonical_url, now have 2 parameters, one for the url to filter and one for print.
In this way i can get the url cleaned in customize.php for $return.
But after your comment i think that a function that wrap wp_admin_canonical_url and to the same thing is better.
#4
@
9 years ago
- Keywords has-patch added; needs-patch removed
Oops, wrong file extension, but you'll get the point. My patch introduces a new wp_removable_query_args
function.
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
9 years ago
#6
@
9 years ago
- Milestone changed from Awaiting Review to Future Release
32692.diff is exactly what I was thinking.
#7
@
9 years ago
- Keywords dev-feedback added
- Milestone changed from Future Release to 4.4
32692.2.diff is an updated patch for trunk. I also simplified the wp_removable_query_args
function a bit. IMHO a good candidate for 4.4.
I'm exploring your plugin i see this:
So filter_removable_query_args return new values in the array and elsewhere is used to add new parameters
to add this parameters.
In wp-admin/customize.php i see two add_query_arg to two different url, home_url and wp_login_url.
Can you help me to find the correct file to edit for fix this bug?