mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Themes: add wp_get_theme_data_custom_templates function.
Adds a new public function, `wp_get_theme_data_custom_templates` that returns the `customTemplates` defined by the active theme from `theme.json`. It also substitutes the usage of private APIs by this new API. Props johnbillion, audrasjb. Fixes #59137 git-svn-id: https://develop.svn.wordpress.org/trunk@56413 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -411,7 +411,7 @@ function _add_block_template_info( $template_item ) {
|
||||
return $template_item;
|
||||
}
|
||||
|
||||
$theme_data = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_custom_templates();
|
||||
$theme_data = wp_get_theme_data_custom_templates();
|
||||
if ( isset( $theme_data[ $template_item['slug'] ] ) ) {
|
||||
$template_item['title'] = $theme_data[ $template_item['slug'] ]['title'];
|
||||
$template_item['postTypes'] = $theme_data[ $template_item['slug'] ]['postTypes'];
|
||||
|
||||
Reference in New Issue
Block a user