Themes: add wp_get_theme_data_template_parts function.
Adds a new public function, `wp_get_theme_data_template_parts` that returns the `templateParts` defined by the active theme from `theme.json`. It also substitutes the usage of private APIs by this new API. Props felixarntz. Fixes #59003 Built from https://develop.svn.wordpress.org/trunk@56385 git-svn-id: http://core.svn.wordpress.org/trunk@55897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -431,7 +431,7 @@ function _add_block_template_info( $template_item ) {
|
||||
*/
|
||||
function _add_block_template_part_area_info( $template_info ) {
|
||||
if ( wp_theme_has_theme_json() ) {
|
||||
$theme_data = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_template_parts();
|
||||
$theme_data = wp_get_theme_data_template_parts();
|
||||
}
|
||||
|
||||
if ( isset( $theme_data[ $template_info['slug'] ]['area'] ) ) {
|
||||
|
||||
Reference in New Issue
Block a user