woocommerce_shipping_rate_label
Filter the shipping rate label.
Usage
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(string)
- The shipping rate label.
- $that(WC_Shipping_Rate)
- The shipping rate object.
Changelog
| Since 3.2.0 | Introduced. |
Where the hook is called
woocommerce_shipping_rate_label
woocommerce/includes/class-wc-shipping-rate.php 285
return apply_filters( 'woocommerce_shipping_rate_label', $this->data['label'], $this );
Where the hook is used in WooCommerce
woocommerce/includes/wc-core-functions.php 45
add_filter( 'woocommerce_shipping_rate_label', 'sanitize_text_field' ); // Shipping rate label.