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

Refactor theme previews #50338

Merged
merged 3 commits into from
May 4, 2023
Merged

Refactor theme previews #50338

merged 3 commits into from
May 4, 2023

Conversation

scruffian
Copy link
Contributor

What?

Refactors the way we filter stylesheet and template to reduce code duplication.

Why?

Makes the code easier to maintain.

How?

Uses current_filter to get the name of the current filter.

Testing Instructions

Check that when you apply ?theme_preview=[theme_path] to your URL, you still see the correct theme being previewed.

@scruffian scruffian requested a review from spacedmonkey as a code owner May 4, 2023 14:57
@scruffian scruffian self-assigned this May 4, 2023
Copy link
Contributor

@MaggieCabrera MaggieCabrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, works as intended, much cleaner now

@scruffian scruffian force-pushed the refactor/theme-previews branch from 864f271 to ec6fb41 Compare May 4, 2023 15:15
@scruffian scruffian enabled auto-merge (squash) May 4, 2023 15:15
@github-actions
Copy link

github-actions bot commented May 4, 2023

Flaky tests detected in 864f271ab346e8d24ed4cbbed8bd5d4f7ef2057b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4884313962
📝 Reported issues:

@scruffian scruffian merged commit 9b821f5 into trunk May 4, 2023
@scruffian scruffian deleted the refactor/theme-previews branch May 4, 2023 15:51
@github-actions github-actions bot added this to the Gutenberg 15.8 milestone May 4, 2023
@bph bph added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended labels May 8, 2023
@ramonjd ramonjd added the Needs PHP backport Needs PHP backport to Core label Jun 5, 2023
@ramonjd ramonjd removed the Needs PHP backport Needs PHP backport to Core label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants