Title: get_allowed_block_template_part_areas
Published: February 3, 2022
Last modified: April 28, 2025

---

# get_allowed_block_template_part_areas(): array[]

## In this article

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

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

Returns a filtered list of allowed area values for template parts.

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

 array[] The allowed template part area values.

 * `...$0` array
 *  Data for the allowed template part area.
    - `area` string
    - Template part area name.
    - `label` string
    - Template part area label.
    - `description` string
    - Template part area description.
    - `icon` string
    - Template part area icon.
    - `area_tag` string
    - Template part area tag.

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

    ```php
    function get_allowed_block_template_part_areas() {
    	$default_area_definitions = array(
    		array(
    			'area'        => WP_TEMPLATE_PART_AREA_UNCATEGORIZED,
    			'label'       => _x( 'General', 'template part area' ),
    			'description' => __(
    				'General templates often perform a specific role like displaying post content, and are not tied to any particular area.'
    			),
    			'icon'        => 'layout',
    			'area_tag'    => 'div',
    		),
    		array(
    			'area'        => WP_TEMPLATE_PART_AREA_HEADER,
    			'label'       => _x( 'Header', 'template part area' ),
    			'description' => __(
    				'The Header template defines a page area that typically contains a title, logo, and main navigation.'
    			),
    			'icon'        => 'header',
    			'area_tag'    => 'header',
    		),
    		array(
    			'area'        => WP_TEMPLATE_PART_AREA_FOOTER,
    			'label'       => _x( 'Footer', 'template part area' ),
    			'description' => __(
    				'The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'
    			),
    			'icon'        => 'footer',
    			'area_tag'    => 'footer',
    		),
    	);

    	/**
    	 * Filters the list of allowed template part area values.
    	 *
    	 * @since 5.9.0
    	 *
    	 * @param array[] $default_area_definitions {
    	 *     The allowed template part area values.
    	 *
    	 *     @type array ...$0 {
    	 *         Data for the template part area.
    	 *
    	 *         @type string $area        Template part area name.
    	 *         @type string $label       Template part area label.
    	 *         @type string $description Template part area description.
    	 *         @type string $icon        Template part area icon.
    	 *         @type string $area_tag    Template part area tag.
    	 *     }
    	 * }
    	 */
    	return apply_filters( 'default_wp_template_part_areas', $default_area_definitions );
    }
    ```

[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/6.9.4/src/wp-includes/block-template-utils.php#L70)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/block-template-utils.php#L70-L121)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_allowed_block_template_part_areas/?output_format=md#hooks)󠁿

 [apply_filters( ‘default_wp_template_part_areas’, array[] $default_area_definitions )](https://developer.wordpress.org/reference/hooks/default_wp_template_part_areas/)

Filters the list of allowed template part area values.

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

| Uses | Description | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/get_allowed_block_template_part_areas/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_allowed_block_template_part_areas/?output_format=md#)

| Used by | Description | 
| [_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.

  | 
| [WP_REST_Themes_Controller::prepare_item_for_response()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/prepare_item_for_response/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Prepares a single theme output for response.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_allowed_block_template_part_areas/?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%2Fget_allowed_block_template_part_areas%2F)
before being able to contribute a note or feedback.