-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Patterns: provide a way to opt-out of Gutenberg patterns #31922
Comments
I was toying around with a proof of concept here: #31924 just to see what works. Thanks! |
We might not need this now that Gutenberg checks for theme support for There used to be no checks before loading patterns: https://github.com/WordPress/gutenberg/blob/v10.5.4/lib/block-patterns.php Thankfully, later versions now only add patterns where there is theme support for https://github.com/WordPress/gutenberg/blob/release/10.7/lib/block-patterns.php#L244 To prevent both core WordPress and Gutenberg loading/overwriting patterns, it's possible to fire off a call to The effect is broad however. It might therefore still be useful to have fine-grained controls over whether Gutenberg overwrites core blocks and/or loads its own, so I think a discussion of the relevant of #31924 could still be in order. |
There's a new filter in WordPress core to disable just the remote patterns, |
This is documented here: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#disabling-the-default-block-patterns And an additional PR adds documentation for how to remove the remote call is here: #33930 I'm going to close this issue then as it has been addressed, if I missed something please reopen with additional details. 👍 |
The proposed feature
The proposal is that we provide a way to tell the block editor plugin to neither register its own patterns nor update core patterns.
At present, Gutenberg registers new patterns and overwrites/reregisters existing core patterns.
What would this feature address?
This feature would help in the following scenarios:
Where a consumer does not wish to include patterns, they must keep track of all registered patterns and filter them by name (unless there's an easier way?). With varying names such as
core/*
,query/*
andsocial-links/shared-background-color
however, the task becomes more complex.What is your proposed solution?
To allow consumers of the plugin to opt-out of experimental, or preferably all patterns.
Assuming the base proposal is sound, I see two options:
apply_filters( 'register_gutenberg_patterns', true )
andapply_filters( 'update_core_patterns', true )
checks around register_gutenberg_patterns() and update_core_patterns()core/query-large-title-posts
orcore/social-links-monochrome
What do folks think?
The text was updated successfully, but these errors were encountered: