Remove Price at the End of a Specific Target Field’s Value

Code

Filename: gpep-remove-price-text-in-specific-target-field-value.php

<?php
/**
 * Gravity Perks // Easy Passthrough // Remove Price at the End of a Specific Target Field’s Value
 * https://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
 */
// Update '123' to the Tartget Form ID and '4' to the Target field ID.
add_filter( 'gpep_target_field_value_123_4', function( $field_value ) {
	return preg_replace( '/s?(.*?)$/', '', $field_value );
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.