woocommerce_json_search_found_product_attribute_terms
Filter the product attribute terms search results.
Usage
add_filter( 'woocommerce_json_search_found_product_attribute_terms', 'wp_kama_woocommerce_json_search_found_product_attribute_terms_filter', 10, 2 ); /** * Function for `woocommerce_json_search_found_product_attribute_terms` filter-hook. * * @param array $terms The list of matched terms. * @param string $taxonomy The terms taxonomy. * * @return array */ function wp_kama_woocommerce_json_search_found_product_attribute_terms_filter( $terms, $taxonomy ){ // filter... return $terms; }
- $terms(array)
- The list of matched terms.
- $taxonomy(string)
- The terms taxonomy.
Changelog
Since 7.0.0 | Introduced. |
Where the hook is called
woocommerce_json_search_found_product_attribute_terms
woocommerce/includes/class-wc-ajax.php 1962
wp_send_json( apply_filters( 'woocommerce_json_search_found_product_attribute_terms', $terms, $taxonomy ) );