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

Block Pattern Directory: Provide documented way to disable #32591

Closed
annezazu opened this issue Jun 10, 2021 · 5 comments · Fixed by #33930
Closed

Block Pattern Directory: Provide documented way to disable #32591

annezazu opened this issue Jun 10, 2021 · 5 comments · Fixed by #33930
Assignees
Labels
[Feature] Pattern Directory The Pattern Directory, a place to find patterns [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@annezazu
Copy link
Contributor

What problem does this address?

Similar to this issue related to the block plugin directory #23961, there needs to be a documented and official way to disable the Block Pattern Directory. For example, an agency may not want clients adding in patterns, especially since they are theme agnostic.

This is somewhat related to this PR #31924

What is your proposed solution?

I recommend offering a similar solution as documented for the Block Plugin directory so there is some consistency: https://developer.wordpress.org/block-editor/reference-guides/filters/editor-filters/#block-directory

If this is already in place and I missed it, apologies! I haven't seen this determined yet and would like to get it defined as people are inevitably going to ask.

cc @priethor @youknowriad

@annezazu annezazu added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Feature] Pattern Directory The Pattern Directory, a place to find patterns labels Jun 10, 2021
@priethor
Copy link
Contributor

Thanks, @annezazu, this looks like something pretty important to get in place before 5.8.

@youknowriad
Copy link
Contributor

There's already a way to disable core block patterns and AFAIK the patterns loaded from the Directory in 5.8 are only the ones considered "core", so I think we're good. cc @ryelle for confirmation though.

@annezazu
Copy link
Contributor Author

Ah ha, got it. I made an assumption there that was wrong. Seems like this can be punted for 5.9 in that case :)

@ryelle
Copy link
Contributor

ryelle commented Jun 10, 2021

I added a filter when this was merged into core, should_load_remote_block_patterns, assuming that people will want to disable remote calls. I didn't port it back to GB, but like @youknowriad said, removing support for the core patterns will also disable it.

@priethor
Copy link
Contributor

Thanks for the reminder of such an important detail! Let's take this out of the 5.8 board and leave it open until the filter is backported.

@annezazu annezazu added the [Type] Enhancement A suggestion for improvement. label Jun 10, 2021
mkaz added a commit that referenced this issue Aug 6, 2021
Adds a new section to the editor filters documentation
for the filter `should_load_remote_block_patterns`

Fixes #32591
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 6, 2021
mkaz added a commit that referenced this issue Aug 6, 2021
Adds a new section to the editor filters documentation
for the filter `should_load_remote_block_patterns`

Fixes #32591
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Pattern Directory The Pattern Directory, a place to find patterns [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants