Skip to content

Commit e63d66b

Browse files
authored
gpls-disable-specific-limits-for-logged-in-users.php: Added new snippet to disable specific GP Limit Submission feeds for logged in users.
1 parent c67bbaf commit e63d66b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Gravity Perks // GP Limit Submissions // Disable Specific Limits for Logged In Users
3+
* https://gravitywiz.com/documentaiton/gravity-forms-limit-submissions/
4+
*
5+
* Instructions:
6+
*
7+
* 1. Install the snippet.
8+
* https://gravitywiz.com/documentation/managing-snippets/
9+
*
10+
* 2. Configure the snippet based on inline instructions.
11+
*/
12+
// Update `123` to your form ID
13+
add_filter( 'gpls_rule_groups_123', function( $rule_groups, $form_id ) {
14+
15+
if( ! is_user_logged_in() ){
16+
return $rule_groups;
17+
}
18+
19+
// Enter a comma separated list of GPLS feed IDs you need to disable
20+
$rules_to_disable = array( 68 );
21+
22+
$new_rules = array();
23+
24+
foreach( $rule_groups as $rule ){
25+
if( ! in_array( $rule->feed_id, $rules_to_disable ) ){
26+
$new_rules[] = $rule;
27+
}
28+
}
29+
30+
return $new_rules;
31+
32+
}, 10, 2 );

0 commit comments

Comments
 (0)