Skip to content
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

Add missing trailing slash on landingPage wp-admin path #1454

Merged
merged 1 commit into from
May 22, 2024

Conversation

ironprogrammer
Copy link
Contributor

What is this PR doing?

Adds a trailing slash to the blueprint's landingPage value.

What problem is it solving?

When using the WordPress PR previewer, after WP admin loads, all menu sidebar links redirect to the homepage.

The blueprint setting for landingPage is configured as /wp-admin. The missing trailing slash results in the menu sidebar links being incorrect, in turn causing link clicks to redirect to the homepage.

Playground page path showing the WP admin path without a trailing slash

Navigating with the top admin bar links, or manually adding a slash to the Playground page path, can work around the issue.

How is the problem addressed?

The trailing slash allows the generated sidebar links to include/prepend /wp-admin/ to their links.

Compare this with the Gutenberg PR viewer, which includes the trailing slash.

Testing Instructions

  1. Open https://playground.wordpress.net/wordpress.html.
  2. Paste in a PR ID or URL and click "Go".
  3. ✅ In the Playground that launches, the path in the Playground address bar should include a trailing slash: /wp-admin/.
  4. ✅ Clicking admin sidebar menu items should link to the intended admin pages.

@brandonpayton
Copy link
Member

I am able to reproduce this behavior. The general issue should be fixed with a redirect for all cases by #1417. While that PR is still outstanding, fixing this specific case seems like a fine idea 😄

@brandonpayton brandonpayton merged commit 0034ba2 into WordPress:trunk May 22, 2024
5 checks passed
@ironprogrammer ironprogrammer deleted the fix/admin-menu-paths branch May 22, 2024 22:49
@brandonpayton
Copy link
Member

Thanks for the fix, @ironprogrammer! playground.wordpress.net has been updated with your change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants