#46686 closed defect (bug) (fixed)
Customize Close Button Not Updating URL
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently the close button at the top left of the Customize menu uses whatever URL you visited the Customizer from. If you activate a theme that has documentation, view that page, then go to Appearance->Customize and change to a new theme the exit button still points to the old theme documentation.
Upon trying to exit out, you're redirected to a 'Sorry, you are not allowed to access this page.' message.
To replicate...
- Download Tonic theme ( https://wordpress.org/themes/tonic/ ) or any other that has custom documentation
- Visit the theme documentation ( /wp-admin/themes.php?page=bavotasan_documentation )
- Open up Appearance->Customize from the documentation page
- Activate any other theme
- Attempt to close out of the Customizer using the X at the top left, it will still point to /wp-admin/themes.php?page=bavotasan_documentation even though the theme is no longer active
Attachments (1)
Change History (12)
#2
@
6 years ago
Correct, any screen specific to the previously activated theme, I had just run across the issue messing around with that theme so used it as my example.
In regards to the redirect, I would think that /wp-admin/themes.php would be suitable.
#3
@
6 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
#4
@
6 years ago
Is this even possible to know what is an accepted URL in this case ?
A theme can add query parameters from anywhere, so what allows us to distinguish between core query parameters and custom made ones ?
wp-admin/themes.php?page=bavotasan_documentation is custom but wp-admin/edit.php?post_type=page is not. In my example each URL has query parameters in it.
@SergeyBiryukov do you think it's possible ? Could you share your experience on this ?
#5
@
6 years ago
@Jean-David not sure I follow about the query parameters.... once the Close button is clicked on, it should just redirect back to /wp-admin/themes.php or something theme related whether the current URL has a query parameter or not
#6
@
6 years ago
- Keywords has-patch added; needs-patch removed
I'm not sure if it's a real problem, it's been this behaviour since 3.0. Anyway I tried to make a patch, we'll see.
This ticket was mentioned in Slack in #core by jarretc. View the logs.
6 years ago
#8
@
6 years ago
Looking at 46686.diff, we cannot just remove $wp_customize->get_return_url()
there, as the Close button would then always lead to the Themes screen instead of the previous page.
Seems like some logic should be added to WP_Customize_Manager::get_return_url()
to check if the return link still exists, by checking the $_registered_pages
global, something similar to user_can_access_admin_page()
.
A unit test would also be great, Tests_WP_Customize_Manager::test_return_url()
could be used as an example.
#10
@
6 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 46754:
Seems like this would be an issue with any theme-generated admin screen (or plugin-generated — see #40451), not just documentation screens.
@JarretC Any thoughts about where the "close" link should go after activating the other theme?