woocommerce_json_search_found_product_attribute_terms
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 | Введена. |
Где вызывается хук
woocommerce_json_search_found_product_attribute_terms
woocommerce/includes/class-wc-ajax.php 2211
wp_send_json( apply_filters( 'woocommerce_json_search_found_product_attribute_terms', $terms, $taxonomy ) );
Где используется хук в WooCommerce
woocommerce/src/Internal/ProductAttributes/VisualAttributeTermAdmin.php 59
add_filter( 'woocommerce_json_search_found_product_attribute_terms', array( $this, 'add_visual_data_to_attribute_terms' ), 10, 2 );