woocommerce_shipping_rate_label
Filter the shipping rate label.
Использование
add_filter( 'woocommerce_shipping_rate_label', 'wp_kama_woocommerce_shipping_rate_label_filter', 10, 2 );
/**
* Function for `woocommerce_shipping_rate_label` filter-hook.
*
* @param string $label The shipping rate label.
* @param WC_Shipping_Rate $that The shipping rate object.
*
* @return string
*/
function wp_kama_woocommerce_shipping_rate_label_filter( $label, $that ){
// filter...
return $label;
}
- $label(строка)
- The shipping rate label.
- $that(WC_Shipping_Rate)
- The shipping rate object.
Список изменений
| С версии 3.2.0 | Введена. |
Где вызывается хук
woocommerce_shipping_rate_label
woocommerce/includes/class-wc-shipping-rate.php 285
return apply_filters( 'woocommerce_shipping_rate_label', $this->data['label'], $this );
Где используется хук в WooCommerce
woocommerce/includes/wc-core-functions.php 44
add_filter( 'woocommerce_shipping_rate_label', 'sanitize_text_field' ); // Shipping rate label.