Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan the /patterns directory recursively to find patterns in subfolders. #53668

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

huubl
Copy link
Contributor

@huubl huubl commented Aug 15, 2023

Related:

What?

Right now patterns can't be organized in subfolders, like template parts.

I'm not sure if this needs to be added to: gutenberg/lib/compat/wordpress-6.2/block-patterns.php or somewhere else and what to set as @since?

Furthermore, there are at least two functions that are similar and can perhaps be combined into one function:

json-resolver-gutenberg.php#L703-L715 (Gutenberg plugin)
block-template-utils.php#L223-L242 (Wordpress Core)

Why?

Better organize pattern files.

How?

Scan the /patterns directory recursively to find patterns in subfolders.

Testing Instructions

  1. Add pattern in /patterns/subfolder/my-pattern.php
  2. Open a post or page.
  3. Confirm that 'my-pattern' shows up

Testing Instructions for Keyboard

--

Screenshots or screencast

--

@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @huubl! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Aug 15, 2023
@jorgefilipecosta jorgefilipecosta added [Type] Enhancement A suggestion for improvement. [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Aug 15, 2023
@bgardner
Copy link

bgardner commented Sep 7, 2023

Any update on this? Would love to see this reviewed/added. @jorgefilipecosta @spacedmonkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
3 participants