Filter hook 'default_wp_template_part_areas'

in WP Core File wp-includes/block-template-utils.php at line 120

View Source

default_wp_template_part_areas

Filter Hook
Description
Filters the list of allowed template part area values. Data for the template part area. } }

Hook Information

File Location wp-includes/block-template-utils.php View on GitHub
Hook Type Filter
Line Number 120

Hook Parameters

Type Name Description
array[] $default_area_definitions { The allowed template part area values.

Usage Examples

Basic Usage
<?php
// Hook into default_wp_template_part_areas
add_filter('default_wp_template_part_areas', 'my_custom_filter', 10, 1);

function my_custom_filter($default_area_definitions) {
    // Your custom filtering logic here
    return $default_area_definitions;
}

Source Code Context

wp-includes/block-template-utils.php:120 - How this hook is used in WordPress core
<?php
 115  	 *         @type string $icon        Template part area icon.
 116  	 *         @type string $area_tag    Template part area tag.
 117  	 *     }
 118  	 * }
 119  	 */
 120  	return apply_filters( 'default_wp_template_part_areas', $default_area_definitions );
 121  }
 122  
 123  
 124  /**
 125   * Returns a filtered list of default template types, containing their

PHP Documentation

<?php
/**
	 * 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.
	 *     }
	 * }
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/block-template-utils.php
Related Hooks

Related hooks will be displayed here in future updates.