woocommerce_blocks_hook_compatibility_additional_data
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.
Usage
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(array)
- Additional hooked data. Default to empty
Changelog
Since 9.5.0 | Introduced. |
Where the hook is called
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() );