diff --git a/plugins/woocommerce/includes/class-wc-shipping-rate.php b/plugins/woocommerce/includes/class-wc-shipping-rate.php index 7357d2112c9..34d27ae2552 100644 --- a/plugins/woocommerce/includes/class-wc-shipping-rate.php +++ b/plugins/woocommerce/includes/class-wc-shipping-rate.php @@ -256,6 +256,42 @@ class WC_Shipping_Rate { return apply_filters( 'woocommerce_get_shipping_tax', count( $this->taxes ) > 0 && ! WC()->customer->get_is_vat_exempt() ? (float) array_sum( $this->taxes ) : 0.0, $this ); } + /** + * Get rate description. + * + * @since 9.2.0 + * @return string + */ + public function get_description() { + /** + * Filter the shipping rate description. + * + * @since 9.2.0 + * + * @param string $description The current description. + * @param WC_Shipping_Rate $this The shipping rate. + */ + return apply_filters( 'woocommerce_shipping_rate_description', $this->data['description'], $this ); + } + + /** + * Get rate delivery time. + * + * @since 9.2.0 + * @return string + */ + public function get_delivery_time() { + /** + * Filter the shipping rate delivery time. + * + * @since 9.2.0 + * + * @param string $delivery_time The current description. + * @param WC_Shipping_Rate $this The shipping rate. + */ + return apply_filters( 'woocommerce_shipping_rate_delivery_time', $this->data['delivery_time'], $this ); + } + /** * Add some meta data for this rate. *