wc_get_template
Использование
add_filter( 'wc_get_template', 'wp_kama_wc_get_template_filter', 10, 4 ); /** * Function for `wc_get_template` filter-hook. * * @param $file * @param $array * @param $WC()->template_path * @param $WC()->plugin_path() /templates/ * * @return */ function wp_kama_wc_get_template_filter( $file, $array, $WC()->template_path, $WC()->plugin_path() /templates/ ){ // filter... return $file; }
- $file
- -
- $array
- -
- $WC()->template_path
- -
- $WC()->plugin_path() /templates/
- -
Где вызывается хук
wc_get_template
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php 1183
$located = apply_filters( 'wc_get_template', $file, $file, array(), WC()->template_path(), WC()->plugin_path() . '/templates/' );
woocommerce/includes/wc-core-functions.php 313
$filter_template = apply_filters( 'wc_get_template', $template, $template_name, $args, $template_path, $default_path );
Где используется хук в WooCommerce
woocommerce/packages/woocommerce-blocks/src/Domain/Services/Notices.php 47
add_filter( 'wc_get_template', [ $this, 'get_notices_template' ], 10, 5 );