WordPress / WordPress/pattern-directory

Add UI for blockType and postType

Open
#609 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Component] Pattern Creator
Dominant language
PHP
Stars
134
Forks
46
Avg merge
9h 4m
Merged PRs (30d)
19

Description

Page patterns are companions of blocks that together form a page layout, or design. They are leveraged within StartPageOptionsModal, as starter patterns you can use to quickly add whole page designs.

Registering a page pattern includes setting the blockType to core/post-content and setting the postType to `page. Here's how Twenty Twenty-Four does it. Block types are an array of blocks that the pattern is intended to be used with.

While we do have some behind-the-scenes workarounds here, for indicating core header and footer patterns, there is no interface.

I'd like to propose a method for registering a pattern's block type, and supported post type (post and page) within the pattern creation experience of the directory. That way a theme author can build headers, footers, and page designs in the pattern directory, and add them to themes via theme.json. Whereas the alternative is to include all of them within all themes individually.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pattern creation experience and the StartPageOptionsModal mentioned in the issue, then compare the existing core header and footer workaround in bin/set-core-pattern.php. Review the Twenty Twenty-Four pattern registration and theme.json examples to understand the expected blockType and postType values. Done means authors can set supported block and post types through the directory UI and use the resulting patterns in themes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.