Skip to content

refactor: static patterns as native WordPress patterns, at the theme root - #2

Merged
ogorzalka merged 1 commit into
mainfrom
refactor/native-patterns
Sep 29, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
refactor/native-patterns

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

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/patterns mixed Blade and .html, and the .html format duplicated what WordPress already does natively with patterns/*.php.

It also fixes a real break: .html patterns 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 the locked leg of #1 shows.

Change

  • resources/views/patterns/*.html → patterns/*.php (git mv, header turned into WordPress's docblock; markup unchanged).
  • colophon.blade.php stays in resources/views/patterns: it needs PHP for the year.
  • README: the rule, and WordPress's pattern cache (delete_pattern_cache() or WP_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).

…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.
@ogorzalka
ogorzalka merged commit 7cafbc3 into main Sep 29, 2026
@ogorzalka
ogorzalka deleted the refactor/native-patterns branch September 29, 2026 14:31
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.

1 participant