woocommerce_json_search_found_product_attribute_terms filter-hookWC 7.0.0

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

WC_AJAX::json_search_taxonomy_terms()
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 ) );

Where the hook is used in WooCommerce

Usage not found.