woocommerce_json_search_found_product_categories filter-hookWC 7.0.0

Filter the product category search results.

Usage

add_filter( 'woocommerce_json_search_found_product_categories', 'wp_kama_woocommerce_json_search_found_product_categories_filter', 10, 2 );

/**
 * Function for `woocommerce_json_search_found_product_categories` filter-hook.
 * 
 * @param array  $found_product_categories Array of matched product categories.
 * @param string $search_text              Search text.
 *
 * @return array
 */
function wp_kama_woocommerce_json_search_found_product_categories_filter( $found_product_categories, $search_text ){

	// filter...
	return $found_product_categories;
}
$found_product_categories(array)
Array of matched product categories.
$search_text(string)
Search text.

Changelog

Since 7.0.0 Introduced.

Where the hook is called

WC_AJAX::json_search_product_attributes()
woocommerce_json_search_found_product_categories
woocommerce/includes/class-wc-ajax.php 2001
wp_send_json( apply_filters( 'woocommerce_json_search_found_product_categories', $found_product_categories, $search_text ) );

Where the hook is used in WooCommerce

Usage not found.