Skip to content

Adopt WP 7.0 block visibility and dimension presets - #108

Closed
jasperf wants to merge 3 commits into
mainfrom
feature/wp7-visibility-and-dimension-presets
Closed

jasperf wants to merge 3 commits into
mainfrom
feature/wp7-visibility-and-dimension-presets

Conversation

@jasperf

@jasperf jasperf commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Two independent, low-risk adoptions from WP 7.0/7.1's new theme.json/block-support features, verified against the WP 7.1 demo instance (Pass 1 wp pattern validate + Pass 3 sentinel, all green). Version bumped to 4.9.3.

  • Native block visibility (header-editorial.php): replaces the @media (max-width: 781px) { display: none } hack that hid the status pill on mobile/tablet with metadata.blockVisibility.viewport, WP 7.0's built-in per-device visibility. Same visual result, no custom CSS.
  • Dimension size presets (theme.json, services-feature-cards.php, stats-showcase.php): adds a settings.dimensions.dimensionSizes scale (xs/sm/md/lg/xl → 40/300/330/600/680px) matching the theme's existing min-height values, and converts the group blocks that reference them from a bare pixel string to the preset var.

Scope note

Checked WordPress core's block.json directly (not just blog summaries) for cover vs group: core/cover does not support the new dimensions preset system — it keeps its own legacy minHeight/minHeightUnit attributes. Only core/group (which does declare supports.dimensions.minHeight) was eligible, so the ~33 minHeight occurrences on wp:cover blocks (hero/banner/WooCommerce patterns) are intentionally left untouched.

Version bump

style.css, package.json, readme.txt (Stable tag + new = 4.9.3 = entry, added above the existing 4.9.2 entry) and CHANGELOG.md (new ## [4.9.3] section) all bumped 4.9.2 → 4.9.3. Tested up to was already 7.1 from the prior release — unchanged.

Testing

  • composer check (Pass 2, pt-cli) — clean
  • wp pattern validate (Pass 1, structural) on the 3 changed pattern files — all PASS
  • npm run validate:file (Pass 3, sentinel/browser) on the 3 changed pattern files — all PASS, 0 errors/warnings

The editorial header hid the status pill on mobile/tablet via a hand-rolled
@media (max-width: 781px) { display: none } rule. WP 7.0 added native
per-device block visibility (metadata.blockVisibility.viewport), which
handles this without custom CSS. Verified via wp pattern validate and
sentinel against the WP 7.1 demo instance.
WP 7.0 added settings.dimensions.dimensionSizes, letting theme.json define
a preset scale for the width/height/min-height dimensions block support
(core/group and similar — confirmed against core's block.json, which does
NOT extend to core/cover's separate legacy minHeight/minHeightUnit
attributes, so cover-block min-heights are left untouched).

Added a 5-step scale (xs/sm/md/lg/xl) matching the exact min-height values
already in use, and converted the two patterns whose group blocks used a
bare style.dimensions.minHeight (services-feature-cards.php: 300px -> sm;
stats-showcase.php: 40px -> xs). Verified via wp pattern validate and
sentinel against the WP 7.1 demo instance.
Covers the two feature commits on this branch: native block visibility on
the editorial header, and dimension size presets in theme.json.
@jasperf jasperf mentioned this pull request Sep 5, 2026
3 tasks
@jasperf

jasperf commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #114 (Release 4.10.0), which cherry-picks the WP 7.0 feature work onto current main and bumps the version to 4.10.0.

@jasperf jasperf closed this Sep 5, 2026
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