refactor: static patterns as native WordPress patterns, at the theme root - #2
Merged
Merged
Conversation
…root The theme root now holds what WordPress reads itself (templates/, parts/, patterns/, theme.json, style.css) and resources/views/ holds Blade only. The six static patterns move from resources/views/patterns/*.html to patterns/*.php, the format WordPress registers natively and the Site Editor exports; the colophon, which needs PHP for the year, stays a Blade pattern. This also makes the theme work on a released framework: the .html patterns needed an unreleased framework change, so on v13.32.0-beta.9 no pattern rendered — no masthead, no index, no article.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
One rule for where a file goes: the theme root holds what WordPress reads itself (
templates/,parts/,patterns/,theme.json,style.css— also what the Site Editor exports),resources/views/holds Blade, compiled by Pollora.resources/views/patternsmixed Blade and.html, and the.htmlformat duplicated what WordPress already does natively withpatterns/*.php.It also fixes a real break:
.htmlpatterns rely on an unreleased framework change (Pollora/framework#354), so on the released v13.32.0-beta.9 no pattern rendered — no masthead, index or article. That is what thelockedleg of #1 shows.Change
resources/views/patterns/*.html→patterns/*.php(git mv, header turned into WordPress's docblock; markup unchanged).colophon.blade.phpstays inresources/views/patterns: it needs PHP for the year.delete_pattern_cache()orWP_DEVELOPMENT_MODE=theme).Checked
On buzz-demo: all seven patterns registered with the same metadata (
Inserter,Block Types); the browser tests of #1 pass on Chromium and Firefox (22/22).