Created
December 22, 2017 02:21
-
-
Save spivurno/82506e4de2c579d6b1e4c083bb753a0f to your computer and use it in GitHub Desktop.
Gravity Perks // GP Limit Submissions // Apply Limit Feeds Globally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // GP Limit Submissions // Apply Limit Feeds Globally | |
* http://gravitywiz.com/documentation/gravity-forms-limit-submissions/ | |
*/ | |
add_filter( 'gpls_rule_groups', function( $rule_groups, $form_id ) { | |
// Update "123" to the ID of your form. | |
$primary_form_id = 123; | |
if( $form_id == $primary_form_id ) { | |
return $rule_groups; | |
} | |
$rule_groups = array_merge( $rule_groups, GPLS_RuleGroup::load_by_form( $primary_form_id ) ); | |
foreach( $rule_groups as $rule_group ) { | |
$rule_group->applicable_forms = false; | |
} | |
return $rule_groups; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👉 This Gist has been migrated to the Gravity Wiz Snippet Library:
https://github.com/gravitywiz/snippet-library/blob/master/gp-limit-submissions/gpls-global-feeds.php