woocommerce_blocks_register_script_dependencies хук-фильтрWC 1.0

Filters the list of script dependencies.

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

add_filter( 'woocommerce_blocks_register_script_dependencies', 'wp_kama_woocommerce_blocks_register_script_dependencies_filter', 10, 2 );

/**
 * Function for `woocommerce_blocks_register_script_dependencies` filter-hook.
 * 
 * @param array  $dependencies The list of script dependencies.
 * @param string $handle       The script's handle.
 *
 * @return array
 */
function wp_kama_woocommerce_blocks_register_script_dependencies_filter( $dependencies, $handle ){

	// filter...
	return $dependencies;
}
$dependencies(массив)
The list of script dependencies.
$handle(строка)
The script's handle.

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

Api::register_script()
woocommerce_blocks_register_script_dependencies
woocommerce/packages/woocommerce-blocks/src/Assets/Api.php 156
$script_dependencies = apply_filters( 'woocommerce_blocks_register_script_dependencies', $script_data['dependencies'], $handle );

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

woocommerce/packages/woocommerce-blocks/src/Payments/Api.php 48
add_filter( 'woocommerce_blocks_register_script_dependencies', array( $this, 'add_payment_method_script_dependencies' ), 10, 2 );