woocommerce_product_categories_widget_main_term
Usage
add_filter( 'woocommerce_product_categories_widget_main_term', 'wp_kama_woocommerce_product_categories_widget_main_term_filter', 10, 2 ); /** * Function for `woocommerce_product_categories_widget_main_term` filter-hook. * * @param $terms[0] * @param $terms * * @return */ function wp_kama_woocommerce_product_categories_widget_main_term_filter( $terms[0], $terms ){ // filter... return $terms[0]; }
- $terms[0]
- -
- $terms
- -
Where the hook is called
woocommerce_product_categories_widget_main_term
woocommerce/includes/widgets/class-wc-widget-product-categories.php 149
$main_term = apply_filters( 'woocommerce_product_categories_widget_main_term', $terms[0], $terms );