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

Filter the product attribute terms search results.

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

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(массив)
The list of matched terms.
$taxonomy(строка)
The terms taxonomy.

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

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

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

WC_AJAX::json_search_taxonomy_terms()
woocommerce_json_search_found_product_attribute_terms
woocommerce/includes/class-wc-ajax.php 1777
wp_send_json( apply_filters( 'woocommerce_json_search_found_product_attribute_terms', $terms, $taxonomy ) );

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

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