diff --git a/lib/compat/wordpress-6.2/block-patterns.php b/lib/compat/wordpress-6.2/block-patterns.php index 266f177d55447..2112a8c2c890f 100644 --- a/lib/compat/wordpress-6.2/block-patterns.php +++ b/lib/compat/wordpress-6.2/block-patterns.php @@ -433,7 +433,7 @@ function gutenberg_register_remote_theme_patterns() { return; } - $pattern_settings = WP_Theme_JSON_Resolver_Gutenberg::get_theme_data()->get_patterns(); + $pattern_settings = gutenberg_get_remote_theme_patterns(); if ( empty( $pattern_settings ) ) { return; } diff --git a/lib/compat/wordpress-6.3/get-global-styles-and-settings.php b/lib/compat/wordpress-6.3/get-global-styles-and-settings.php index 9f46b3159e931..5b4ff3a5dd5cb 100644 --- a/lib/compat/wordpress-6.3/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.3/get-global-styles-and-settings.php @@ -186,3 +186,15 @@ function wp_get_block_css_selector( $block_type, $target = 'root', $fallback = f return null; } } + +/** + * Returns the current theme's wanted patterns(slugs) to be + * registered from Pattern Directory. + * + * @since 6.3.0 + * + * @return string[] + */ +function gutenberg_get_remote_theme_patterns() { + return WP_Theme_JSON_Resolver_Gutenberg::get_theme_data( array(), array( 'with_supports' => false ) )->get_patterns(); +}