mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 18:08:09 +01:00
Themes: add wp_get_remote_theme_patterns function.
Adds a new public function, `wp_get_remote_theme_patterns` to query the `patterns` datum from `theme.json` and substitutes current usage of private APIs. Props ntsekouras, poena, audrasjb. Fixes #58460 Built from https://develop.svn.wordpress.org/trunk@55926 git-svn-id: http://core.svn.wordpress.org/trunk@55438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9bb36a1453
commit
43c3e172e0
@ -287,7 +287,7 @@ function _register_remote_theme_patterns() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pattern_settings = WP_Theme_JSON_Resolver::get_theme_data()->get_patterns();
|
$pattern_settings = wp_get_remote_theme_patterns();
|
||||||
if ( empty( $pattern_settings ) ) {
|
if ( empty( $pattern_settings ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -426,3 +426,15 @@ function wp_clean_theme_json_cache() {
|
|||||||
wp_cache_delete( 'wp_get_global_styles_custom_css', 'theme_json' );
|
wp_cache_delete( 'wp_get_global_styles_custom_css', 'theme_json' );
|
||||||
WP_Theme_JSON_Resolver::clean_cached_data();
|
WP_Theme_JSON_Resolver::clean_cached_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current theme's wanted patterns (slugs) to be
|
||||||
|
* registered from Pattern Directory.
|
||||||
|
*
|
||||||
|
* @since 6.3.0
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
function wp_get_remote_theme_patterns() {
|
||||||
|
return WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_patterns();
|
||||||
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.3-alpha-55924';
|
$wp_version = '6.3-alpha-55926';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user