WooCommerce Variable Product Price – Where is “From” text generated from?

The following code from github will add “- [max price]” to all variable products displayed in product archives.

I am wondering how I could also remove the “From” text inside the same filter.

add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);

function custom_variation_price( $price, $product ) {

     $price = '';

     if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';

     $price .= woocommerce_price($product->get_price());

     if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) {
          $price .= '<span class="to"> ' . _x('-', 'max_price', 'woocommerce') . ' </span>';

          $price .= woocommerce_price($product->max_variation_price);
     }

     return $price;
}

I noticed this question answers how to remove the From text using the same filter parameters, but I haven’t been able to figure out how this works.

Solutions Collecting From Web of "WooCommerce Variable Product Price – Where is “From” text generated from?"

Go with commenting out this line:

 if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';

and this won’t be added to the price output.

Well, it turns out I have done it but without really exactly how everything works.

add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);

function custom_variation_price( $price, $product ) {

     $price = '';

     if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';

     $price .= woocommerce_price($product->get_price());

     if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) {
          $price .= '<span class="to"> ' . _x('-', 'max_price', 'woocommerce') . ' </span>';

          $price .= woocommerce_price($product->max_variation_price);
     }

     return $price;
}

I just change this line:

if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';

to:

if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price )

Does anyone know exactly how the _x() function works? I did see their documentation but its not really descriptive.