build_template_part_block_variations()WP 1.0

Returns an array of variation objects for the template part block.

Хуков нет.

Возвращает

Массив. Array containing the block variation objects.

Использование

build_template_part_block_variations();

Код build_template_part_block_variations() WP 6.0.2

function build_template_part_block_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;
}