Automattic\WooCommerce\Blocks

BlockTemplatesRegistry::register_add_to_cart_with_options_template_part_area │ public │ WC 1.0

Add Add to Cart + Options to the default template part areas.

Метод класса: BlockTemplatesRegistry{}

Хуков нет.

Возвращает

array. The supported template part areas including the Add to Cart + Options one.

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

$BlockTemplatesRegistry = new BlockTemplatesRegistry();
$BlockTemplatesRegistry->register_add_to_cart_with_options_template_part_area( $default_area_definitions );
$default_area_definitions(массив) (обязательный)
An array of supported area objects.

Код BlockTemplatesRegistry::register_add_to_cart_with_options_template_part_area() WC 11.2.2

public function register_add_to_cart_with_options_template_part_area( $default_area_definitions ) {
	$add_to_cart_with_options_template_part_area = array(
		'area'        => 'add-to-cart-with-options',
		'label'       => __( 'Add to Cart + Options', 'woocommerce' ),
		'description' => __( 'The Add to Cart + Options templates allow defining a different layout for each product type.', 'woocommerce' ),
		'icon'        => 'add-to-cart-with-options',
		'area_tag'    => 'add-to-cart-with-options',
	);
	return array_merge( $default_area_definitions, array( $add_to_cart_with_options_template_part_area ) );
}