woocommerce_api_product_attribute_response
Использование
add_filter( 'woocommerce_api_product_attribute_response', 'wp_kama_woocommerce_api_product_attribute_response_filter', 10, 5 ); /** * Function for `woocommerce_api_product_attribute_response` filter-hook. * * @param $product_attribute * @param $id * @param $fields * @param $attribute * @param $that * * @return */ function wp_kama_woocommerce_api_product_attribute_response_filter( $product_attribute, $id, $fields, $attribute, $that ){ // filter... return $product_attribute; }
- $product_attribute
- -
- $id
- -
- $fields
- -
- $attribute
- -
- $that
- -
Где вызывается хук
woocommerce_api_product_attribute_response
woocommerce_api_product_attribute_response
woocommerce/includes/legacy/api/v3/class-wc-api-products.php 2462
return array( 'product_attribute' => apply_filters( 'woocommerce_api_product_attribute_response', $product_attribute, $id, $fields, $attribute, $this ) );
woocommerce/includes/legacy/api/v3/class-wc-api-products.php 2827
return array( 'product_attribute_term' => apply_filters( 'woocommerce_api_product_attribute_response', $attribute_term, $id, $fields, $term, $this ) );
woocommerce/includes/legacy/api/v2/class-wc-api-products.php 1909
return array( 'product_attribute' => apply_filters( 'woocommerce_api_product_attribute_response', $product_attribute, $id, $fields, $attribute, $this ) );