#56112 closed enhancement (fixed)
Allow remote pattern registration in theme.json when core patterns are disabled
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.0.2 | Priority: | normal |
Severity: | normal | Version: | 6.0 |
Component: | Editor | Keywords: | has-patch fixed-major |
Focuses: | Cc: |
Description
Fixes: https://github.com/WordPress/gutenberg/issues/41282
In 6.0 we now have functionality that allows you to register selected remote patterns (from the Pattern Directory) via theme.json. While this is great, it requires you to fully enable all core and remote patterns. This can be a blocker to adoption.
Many theme authors want to have all core and remote patterns disabled by default using remove_theme_support( 'core-block-patterns' ). This ensures they are serving only patterns relevant to their theme to customers/clients.
This PR/Trac ticket removes the theme support and remote filter checks from the function that registers remote patterns specified in theme.json. This allows theme authors to disable core patterns but then selectively register the ones they want from the Pattern Directory. We assume that if a theme author intentionally specifies patterns in theme.json, they intend for them to be present in the pattern inserter and the checks are not required.
This change will make the Pattern Directory more appealing/usable from the theme author's perspective.
Note, that while this issue is technically not a "bug", it is a pretty large blocker for Pattern Directory adoption and I feel should be considered for 6.0.1.
Change History (12)
This ticket was mentioned in PR #2925 on WordPress/wordpress-develop by ndiego.
3 years ago
#1
- Keywords has-patch added
3 years ago
#2
I think removing the get_theme_support( 'core-block-patterns' )
check makes sense here — these aren't core patterns. But the should_load_remote_block_patterns
check should stay, in case someone wants to explicitly disable external API requests.
For reference, there's only 1 theme in the wp.org directory that disables the remote loading, but it loads its patterns locally.
3 years ago
#3
Thanks for the feedback @ryelle! That makes good sense. I have updated the PR and added back the should_load_remote_block_patterns
.
This ticket was mentioned in Slack in #core by ndiego. View the logs.
3 years ago
3 years ago
#6
Thanks @ryelle, are you able to merge? I don't have permission on this repo. In the meantime, I will put together the corresponding PR needed on the Gutenberg side.
#7
@
3 years ago
- Owner set to audrasjb
- Status changed from new to accepted
Self assigning for commit
as asked by Nick in this thread.
#9
@
3 years ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for 6.0.2 backport consideration.
3 years ago
#10
Committed in https://core.trac.wordpress.org/changeset/53793
Fixes: https://github.com/WordPress/gutenberg/issues/41282
In 6.0 we now have functionality that allows you to register selected remote patterns (from the Pattern Directory) via theme.json. While this is great, it requires you to fully enable all core and remote patterns. This can be a blocker to adoption.
Many theme authors want to have all core and remote patterns disabled by default using remove_theme_support( 'core-block-patterns' ). This ensures they are serving only patterns relevant to their theme to customers/clients.
This PR/Trac ticket removes the theme support and remote filter checks from the function that registers remote patterns specified in theme.json. This allows theme authors to disable core patterns but then selectively register the ones they want from the Pattern Directory. We assume that if a theme author intentionally specifies patterns in theme.json, they intend for them to be present in the pattern inserter and the checks are not required.
This change will make the Pattern Directory more appealing/usable from the theme author's perspective.
Note, that while this issue is technically not a "bug", it is a pretty large blocker for Pattern Directory adoption and I feel should be considered for 6.0.1.
Trac ticket: https://core.trac.wordpress.org/ticket/56112