Skip to content

Commit 3fd3d5c

Browse files
committed
Added gppr-validation-messages.php
Original Gist: https://gist.github.com/spivurno/0101cef16768da629ff24b8e1ab07891
1 parent d32c20d commit 3fd3d5c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Gravity Perks // GP Price Range // Modify Validation Messages
4+
* http://gravitywiz.com/documentation/gp-price-range/
5+
*/
6+
add_filter( 'gppr_validation_messages', function( $messages, $min, $max, $form_id, $field_id ) {
7+
8+
$min = GFCommon::to_money( $min );
9+
$max = GFCommon::to_money( $max );
10+
11+
$messages['min_and_max'] = sprintf( 'Please enter an amount between %s and %s.', $min, $max );
12+
$messages['min'] = sprintf( 'Please enter a price greater than or equal to %s.', $min );
13+
$messages['max'] = sprintf( 'Please enter a price less than or equal to %s.', $max );
14+
15+
return $messages;
16+
}, 10, 5 );

0 commit comments

Comments
 (0)