build_template_part_block_area_variations

函数


build_template_part_block_area_variations ( No parameters )
返回值
  • (array) Array containing the block variation objects.
定义位置
  • wp-includes/blocks/template-part.php
    , line 166
引入
弃用

返回模板零件块的面积变化对象的数组。

function build_template_part_block_area_variations() {
	$variations    = array();
	$defined_areas = get_allowed_block_template_part_areas();
	foreach ( $defined_areas as $area ) {
		if ( 'uncategorized' !== $area['area'] ) {
			$variations[] = array(
				'name'        => $area['area'],
				'title'       => $area['label'],
				'description' => $area['description'],
				'attributes'  => array(
					'area' => $area['area'],
				),
				'scope'       => array( 'inserter' ),
				'icon'        => $area['icon'],
			);
		}
	}
	return $variations;
}