woocommerce_blocks_hook_compatibility_additional_data хук-фильтрWC 9.5.0

When extensions implement their equivalent blocks of the template hook functions, they can use this filter to register their old hooked data here, so in the blockified template, the old hooked functions can be removed in favor of the new blocks while keeping the old hooked functions working in classic templates.

Accepts an array of hooked data. The array should be in the following format: [ [

hook => <hook-name>,
function => <function-name>,
priority => <priority>,

], ... ] Where:

  • hook-name is the name of the hook that have the functions hooked to.
  • function-name is the hooked function name.
  • priority is the priority of the hooked function.

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

add_filter( 'woocommerce_blocks_hook_compatibility_additional_data', 'wp_kama_woocommerce_blocks_hook_compatibility_additional_data_filter' );

/**
 * Function for `woocommerce_blocks_hook_compatibility_additional_data` filter-hook.
 * 
 * @param array $data Additional hooked data. Default to empty
 *
 * @return array
 */
function wp_kama_woocommerce_blocks_hook_compatibility_additional_data_filter( $data ){

	// filter...
	return $data;
}
$data(массив)
Additional hooked data. Default to empty

Список изменений

С версии 9.5.0 Введена.

Где вызывается хук

AbstractTemplateCompatibility::remove_default_hooks()
woocommerce_blocks_hook_compatibility_additional_data
woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php 165
$additional_hook_data = apply_filters( 'woocommerce_blocks_hook_compatibility_additional_data', array() );

Где используется хук в WooCommerce

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