Automattic\WooCommerce\Blocks\Templates

SingleProductTemplateCompatibility::set_hook_data()protectedWC 1.0

Set supported hooks.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->set_hook_data();

Код SingleProductTemplateCompatibility::set_hook_data() WC 8.7.0

protected function set_hook_data() {
	$this->hook_data = array(
		'woocommerce_before_main_content'           => array(
			'block_names' => array(),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_output_content_wrapper' => 10,
				'woocommerce_breadcrumb'             => 20,
			),
		),
		'woocommerce_after_main_content'            => array(
			'block_names' => array(),
			'position'    => 'after',
			'hooked'      => array(
				'woocommerce_output_content_wrapper_end' => 10,
			),
		),
		'woocommerce_sidebar'                       => array(
			'block_names' => array(),
			'position'    => 'after',
			'hooked'      => array(
				'woocommerce_get_sidebar' => 10,
			),
		),
		'woocommerce_before_single_product'         => array(
			'block_names' => array(),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_output_all_notices' => 10,
			),
		),
		'woocommerce_before_single_product_summary' => array(
			'block_names' => array( 'core/post-excerpt' ),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_show_product_sale_flash' => 10,
				'woocommerce_show_product_images'     => 20,
			),
		),
		'woocommerce_single_product_summary'        => array(
			'block_names' => array( 'core/post-excerpt' ),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_template_single_title'   => 5,
				'woocommerce_template_single_rating'  => 10,
				'woocommerce_template_single_price'   => 10,
				'woocommerce_template_single_excerpt' => 20,
				'woocommerce_template_single_add_to_cart' => 30,
				'woocommerce_template_single_meta'    => 40,
				'woocommerce_template_single_sharing' => 50,
			),
		),
		'woocommerce_after_single_product'          => array(
			'block_names' => array(),
			'position'    => 'after',
			'hooked'      => array(),
		),
		'woocommerce_product_meta_start'            => array(
			'block_names' => array( 'woocommerce/product-meta' ),
			'position'    => 'before',
			'hooked'      => array(),
		),
		'woocommerce_product_meta_end'              => array(
			'block_names' => array( 'woocommerce/product-meta' ),
			'position'    => 'after',
			'hooked'      => array(),
		),
		'woocommerce_share'                         => array(
			'block_names' => array( 'woocommerce/product-details' ),
			'position'    => 'before',
			'hooked'      => array(),
		),
		'woocommerce_after_single_product_summary'  => array(
			'block_names' => array( 'woocommerce/product-details' ),
			'position'    => 'after',
			'hooked'      => array(
				'woocommerce_output_product_data_tabs' => 10,
				// We want to display the upsell products after the last block that belongs to the Single Product.
				// 'woocommerce_upsell_display'           => 15.
				'woocommerce_output_related_products'  => 20,
			),
		),
	);
}