-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Theme Previews: Make the back button customizable #54242
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.4/theme-previews.php ❔ lib/load.php |
Size Change: +5.44 kB (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
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.
This feels a little less complex than #54174 which adds a second customisation point in __experimentalThemePreviewBackLink
. By having core filter __experimentalDashboardLink
when previewing a theme and allowing plugins to re-filter that we reuse the original customisation point.
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.
@scruffian Are you also able to filter the link text? Changing the URL without changing the text sounds like the beginnings of an accessibility and UX nightmare. If you select "Back" and end up at https://wordpress.com, this link did something different than what a user would have expected it to do.
I changed it to make the backlink text customizable! |
Flaky tests detected in 14c75ac. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6155432188
|
Thanks for the update @okmttdhr, I agree, let's get this in. |
What?
This PR makes the Back link on Block Theme Previews extensible with the settings store. Alternative to #54174.
Why?
Sometimes, 3rd party apps want to extend the Back link, as going back to /themes.php does not always make sense. c.f. Automattic/wp-calypso#80595
How?
The dashboard link is already customizable, but the theme preview path doesn't allow for the customization. This changes the way we modify the back link for the theme preview path so that it is also customizable.
Testing Instructions
You can also test that this is extensible by adding a plugin that modifies the editor settings:
Screenshots or screencast