(hook_prefix)(prop) │ хук-фильтр │ WC 11.3.0

Filters a resolved customs value: woocommerce_product_variation_get_customs_commodity_code, woocommerce_product_variation_get_customs_country_of_origin, or woocommerce_product_variation_get_customs_description.

The dynamic portion of the hook name, $prop, refers to the customs prop name. Runs for the variation's own value via get_prop() (may be null), and again with the parent value when the variation inherits it.

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

add_filter( '(hook_prefix)(prop)', 'wp_kama_hook_prefixprop_filter', 10, 2 );

/**
 * Function for `(hook_prefix)(prop)` filter-hook.
 * 
 * @param string|null          $value     Customs value.
 * @param WC_Product_Variation $variation Product variation.
 *
 * @return string|null
 */
function wp_kama_hook_prefixprop_filter( $value, $variation ){
	// filter...
	return $value;
}
$value(строка|null)
Customs value.
$variation(WC_Product_Variation)
Product variation.

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

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

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

WC_Product_Variation::get_customs_prop()
(hook_prefix)(prop)
WC_Data::get_prop()
(hook_prefix)(prop)
WC_Customer::get_billing()
(hook_prefix)(prop)
WC_Customer::get_shipping()
(hook_prefix)(prop)
woocommerce/includes/class-wc-product-variation.php 289
$value = apply_filters( $this->get_hook_prefix() . $prop, $this->parent_data[ $prop ], $this );
woocommerce/includes/abstracts/abstract-wc-data.php 960
$value = apply_filters( $this->get_hook_prefix() . $prop, $value, $this );
woocommerce/includes/class-wc-customer.php 586
$value = apply_filters( $this->get_hook_prefix() . $prop, $value, $this );
woocommerce/includes/class-wc-customer.php 729
$value = apply_filters( $this->get_hook_prefix() . $prop, $value, $this );

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

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