Make WordPress Core


Ignore:
Timestamp:
08/11/2023 11:22:54 AM (3 years ago)
Author:
oandregal
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template-utils.php

    r56329 r56385  
    432432function _add_block_template_part_area_info( $template_info ) {
    433433        if ( wp_theme_has_theme_json() ) {
    434                 $theme_data = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_template_parts();
     434                $theme_data = wp_get_theme_data_template_parts();
    435435        }
    436436
Note: See TracChangeset for help on using the changeset viewer.