woocommerce_get_price_html_from_text

Returns a 'from' prefix if you want to show where prices start at.

Description

(string) apply_filters( 'woocommerce_get_price_html_from_text', (string) $span_class_from_x_from_min_price_woocommerce_span ); 

Returns (string)

Parameters (1)

0. $span_class_from_x_from_min_price_woocommerce_span — Optional. (string) => '' . _x( 'From:', 'min_price', 'woocommerce' ) . ' '
The span class from x from min price woocommerce span.

Usage

To run the hook, copy the example below.
  1. $span_class_from_x_from_min_price_woocommerce_span = apply_filters( 'woocommerce_get_price_html_from_text', $span_class_from_x_from_min_price_woocommerce_span ); 
  2.  
  3. if ( !empty( $span_class_from_x_from_min_price_woocommerce_span ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_get_price_html_from_text callback 
  2. function filter_woocommerce_get_price_html_from_text( $span_class_from_x_from_min_price_woocommerce_span ) { 
  3. // make filter magic happen here... 
  4. return $span_class_from_x_from_min_price_woocommerce_span
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_get_price_html_from_text', 'filter_woocommerce_get_price_html_from_text', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_get_price_html_from_text', 'filter_woocommerce_get_price_html_from_text', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/wc-template-functions.php  
  1. return apply_filters( 'woocommerce_get_price_html_from_text', '<span class="from">' . _x( 'From:', 'min_price', 'woocommerce' ) . ' </span>' );