woocommerce_json_search_found_product_categories хук-фильтрWC 7.0.0

Filter the product category search results.

Использование

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 of matched product categories.
$search_text(строка)
Search text.

Список изменений

С версии 7.0.0 Введена.

Где вызывается хук

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

Где используется хук в WooCommerce

Использование не найдено.