10up / wp-scaffold

10up WordPress project scaffold.
MIT License
204 stars 48 forks source link

Update Pattern Registration flow in theme to use `patterns` directory #113

Closed fabiankaegy closed 2 years ago

fabiankaegy commented 2 years ago

Description of the Change

WordPress 6.0 introduces the ability to register patterns via the patterns/ directory at the root of the theme. This mechanism makes it much simpler to manage patterns and therefore is what I would recommend going forward.

The Dev Note is not jet published but you can view the draft here: https://github.com/WordPress/gutenberg/issues/39654#issuecomment-1096823783

Closes #100

Alternate Designs

Possible Drawbacks

Verification Process

?>

Example Pattern


- Open the editor and view that the pattern shows up in the pattern picker

### Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [x] I have read the [**CONTRIBUTING**](/CONTRIBUTING.md) document.
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [ ] I have added tests to cover my change.
- [x] All new and existing tests passed.

<!-- _NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open._ -->

### Changelog Entry

<!--
Add sample CHANGELOG.md entry for this PR, noting whether this is something being Added / Changed / Deprecated / Removed / Fixed / or Security related.
Example:
> Added - New feature
> Changed - Existing functionality
> Deprecated - Soon-to-be removed feature
> Removed - Feature
> Fixed - Bug fix
> Security - Vulnerability
-->

Changed how patterns are being registered to align with the API introduced in WordPress 6.0 

### Credits

<!-- Please list any and all contributors on this PR and any linked issue so that they can be added to this projects CREDITS.md file. -->
Props @