wpseek.com
A WordPress-centric search engine for devs and theme authors



get_allowed_block_template_part_areas › WordPress Function

Since5.9.0
Deprecatedn/a
get_allowed_block_template_part_areas ( No parameters )
Returns:
  • (array[]) { The allowed template part area values. @type array ...$0 { Data for the allowed 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. } }
Defined at:
Codex:

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



Source

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 );
}