Skip to content

Commit e3d7eb5

Browse files
authored
Create gpls-disable-limits-for-specific-ips.php
1 parent 6007fb5 commit e3d7eb5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Gravity Perks // GP Limit Submissions // Disable Limits for a Specific IPs
4+
* http://gravitywiz.com/documentaiton/gravity-forms-limit-submissions/
5+
*/
6+
// Update "123" to the ID of the form.
7+
add_filter( 'gpls_rule_groups_123', function( $rule_groups, $form_id ) {
8+
// Update to a list of IP addresses that should not be limited.
9+
$excempt_ips = array( '192.0.2.255', '198.51.100.10', '203.0.113.11' );
10+
if ( in_array( GFFormsModel::get_ip(), $excempt_ips ) ) {
11+
$rule_groups = array();
12+
}
13+
return $rule_groups;
14+
}, 10, 2 );

0 commit comments

Comments
 (0)