Skip to content

Commit 78d546a

Browse files
sbassahspivurno
andauthored
Override Limit of Specific Choice
* Override Limit of Specific Choice * Update gplc-override-limit-of-specific-choice.php Co-authored-by: David Smith <david@gravitywiz.com>
1 parent 22ddc00 commit 78d546a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Limit Choices // Override Limit of Specific Choice
4+
* https://gravitywiz.com/documentation/gravity-forms-limit-choices/
5+
*/
6+
// Update "123" to the form ID and "4" to the field ID.
7+
add_filter( 'gplc_choice_limit_123_4', function( $limit, $choice ) {
8+
if ( $choice['value'] === 'First Choice' ) {
9+
// Update "1" to the desired limit.
10+
$limit = 1;
11+
}
12+
return $limit;
13+
}, 10, 2 );

0 commit comments

Comments
 (0)