Title: _add_block_template_part_area_info
Published: February 3, 2022
Last modified: May 20, 2026

---

# _add_block_template_part_area_info( array $template_info ): array

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#parameters)󠁿

 `$template_info`arrayrequired

Template to add information to (requires `'type'` and `'slug'` fields).

## 󠀁[Return](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#return)󠁿

 array Template info.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#source)󠁿

    ```php
    function _add_block_template_part_area_info( $template_info ) {
    	if ( wp_theme_has_theme_json() ) {
    		$theme_data = wp_get_theme_data_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 all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/block-template-utils.php#L511)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/block-template-utils.php#L511-L524)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_get_theme_data_template_parts()](https://developer.wordpress.org/reference/functions/wp_get_theme_data_template_parts/)`wp-includes/global-styles-and-settings.php` |

Returns the metadata for the template parts defined by the theme.

  | 
| [wp_theme_has_theme_json()](https://developer.wordpress.org/reference/functions/wp_theme_has_theme_json/)`wp-includes/global-styles-and-settings.php` |

Checks whether a theme or its parent has a theme.json file.

  | 
| [_filter_block_template_part_area()](https://developer.wordpress.org/reference/functions/_filter_block_template_part_area/)`wp-includes/block-template-utils.php` |

Checks whether the input ‘area’ is a supported value.

  |

| Used by | Description | 
| [_get_block_template_file()](https://developer.wordpress.org/reference/functions/_get_block_template_file/)`wp-includes/block-template-utils.php` |

Retrieves the template file from the theme for a given slug.

  | 
| [_get_block_templates_files()](https://developer.wordpress.org/reference/functions/_get_block_templates_files/)`wp-includes/block-template-utils.php` |

Retrieves the template files from the theme.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_add_block_template_part_area_info/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_add_block_template_part_area_info%2F)
before being able to contribute a note or feedback.