From 279c01d0056046f5eea237938e88981e98f2215f Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Thu, 2 Oct 2014 20:11:34 +0100 Subject: [PATCH] Introduce filters to get_price_html_from_text() and get_price_html_from_to(). --- includes/abstracts/abstract-wc-product.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index 5825a0ac8b4..bc8c4902f9f 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -906,7 +906,9 @@ class WC_Product { * @return string */ public function get_price_html_from_text() { - return '' . _x( 'From:', 'min_price', 'woocommerce' ) . ' '; + $from = '' . _x( 'From:', 'min_price', 'woocommerce' ) . ' '; + + return apply_filters( 'woocommerce_get_price_html_from_text', $from, $this ); } /** @@ -917,7 +919,9 @@ class WC_Product { * @return string */ public function get_price_html_from_to( $from, $to ) { - return '' . ( ( is_numeric( $from ) ) ? wc_price( $from ) : $from ) . ' ' . ( ( is_numeric( $to ) ) ? wc_price( $to ) : $to ) . ''; + $price = '' . ( ( is_numeric( $from ) ) ? wc_price( $from ) : $from ) . ' ' . ( ( is_numeric( $to ) ) ? wc_price( $to ) : $to ) . ''; + + return apply_filters( 'woocommerce_get_price_html_from_to', $price, $this ); } /**