_add_block_template_part_area_info() – Attempts to add the template part’s area information to the input template.

You appear to be a bot. Output may be restricted

Description

Attempts to add the template part's area information to the input template.

Usage

$array = _add_block_template_part_area_info( $template_info );

Parameters

$template_info
( array ) required – Template to add information to (requires 'type' and 'slug' fields).

Returns

array Template info.

Source

File name: wordpress/wp-includes/block-template-utils.php
Lines:

1 to 14 of 14
function _add_block_template_part_area_info( $template_info ) {
  if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
    $theme_data = WP_Theme_JSON_Resolver::get_theme_data()->get_template_parts();
  }

  if ( isset( $theme_data[ $template_info['slug'] ]['area'] ) ) {
    $template_info['title'] = $theme_data[ $template_info['slug'] ]['title'];
    $template_info['area']  = _filter_block_template_part_area( $theme_data[ $template_info['slug'] ]['area'] );
  } else {
    $template_info['area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
  }

  return $template_info;
}
 

 View on GitHub View on Trac