Skip to content

Instantly share code, notes, and snippets.

@spivurno
Last active May 25, 2017 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/0101cef16768da629ff24b8e1ab07891 to your computer and use it in GitHub Desktop.
Save spivurno/0101cef16768da629ff24b8e1ab07891 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Price Range // Modify Validation Messages
<?php
/**
* Gravity Perks // GP Price Range // Modify Validation Messages
* http://gravitywiz.com/documentation/gp-price-range/
*/
add_filter( 'gppr_validation_messages', function( $messages, $min, $max, $form_id, $field_id ) {
$min = GFCommon::to_money( $min );
$max = GFCommon::to_money( $max );
$messages['min_and_max'] = sprintf( 'Please enter an amount between %s and %s.', $min, $max );
$messages['min'] = sprintf( 'Please enter a price greater than or equal to %s.', $min );
$messages['max'] = sprintf( 'Please enter a price less than or equal to %s.', $max );
return $messages;
}, 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment