From 6d5d482c72fdab1e59faec0287ec8deedd57ade3 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Fri, 29 Jul 2022 08:29:13 +0000 Subject: [PATCH] Themes: Allow remote pattern registration in `theme.json` when core patterns are disabled. In 6.0 there is now a functionality that allows to register selected remote patterns (from the Pattern Directory) via `theme.json`. However, it requires to fully enable all core and remote patterns. This can be a blocker for user adoption. Many theme authors want to have all core and remote patterns disabled by default using `remove_theme_support( 'core-block-patterns' )`. This changeset ensures they are serving only patterns relevant to their theme. This changeset removes theme support check 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. If a theme author intentionally specifies patterns in `theme.json`, they probably intend for them to be present in the pattern inserter and the check is not required. This change will make the Pattern Directory more appealing/usable from the theme author's perspective. Props ndiego, ryelle. Fixes #56112. git-svn-id: https://develop.svn.wordpress.org/trunk@53793 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-patterns.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/wp-includes/block-patterns.php b/src/wp-includes/block-patterns.php index 58ec8443b1..5c3f7518b8 100644 --- a/src/wp-includes/block-patterns.php +++ b/src/wp-includes/block-patterns.php @@ -133,10 +133,6 @@ function _load_remote_featured_patterns() { * @access private */ function _register_remote_theme_patterns() { - if ( ! get_theme_support( 'core-block-patterns' ) ) { - return; - } - /** This filter is documented in wp-includes/block-patterns.php */ if ( ! apply_filters( 'should_load_remote_block_patterns', true ) ) { return;