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 // Dynamically Set Limit | |
* http://gravitywiz.com/gravity-forms-limit-submissions/ | |
*/ | |
add_filter( 'gpls_rule_groups', function( $rule_groups ) { | |
foreach( $rule_groups as &$rule_group ) { | |
if( $rule_group->name == 'Your Feed Name' ) { | |
$rule_group->limit = 100; |
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 // Display Poll Results When Limit Is Reached | |
* http://gravitywiz.com/documentaiton/gravity-forms-limit-submissions/ | |
*/ | |
add_action( 'gform_get_form_filter', function( $markup, $form ) { | |
if( ! is_callable( 'gf_polls' ) || ! gf_polls()->get_form_setting( $form, 'displayResults' ) ) { | |
return $markup; | |
} |
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 Wiz // Gravity Forms Styles Pro // Force Validation Message | |
* http://gravitywiz.com | |
*/ | |
if( class_exists( 'StylesPro' ) ) { | |
add_filter( 'gform_validation_message', function( $message, $form ) { | |
add_filter( "gform_validation_message_{$form['id']}", array( StylesPro::get_instance(), 'gf_stylespro_validation'), 11, 2 ); | |
}, 10, 2 ); | |
} |
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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gp-nested-forms/gpnf-require-unique-values.php | |
*/ | |
/** | |
* Gravity Perks // GP Nested Forms // Require Unique Value Between Parent & Child | |
* | |
* Throw a validation error if a value is present a child entry that has been entered on the parent form. |
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 Dates // Block Date Range via Exceptions | |
*/ | |
add_filter( 'gpld_limit_dates_options_1364_1', 'gpld_except_date_range', 10, 3 ); | |
function gpld_except_date_range( $options, $form, $field ) { | |
$start_date = '2016-07-15'; | |
$end_date = '2017-01-01'; |
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 Nested Forms // Map Full Child Entry Data via User Registration Add-on | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
add_action( 'gform_user_registration_meta_value', function( $value, $meta_key, $meta, $form, $entry, $is_username ) { | |
if( ! is_callable( 'gp_nested_forms' ) || ! gp_nested_forms()->has_nested_form_field( $form ) ) { | |
return $value; | |
} |
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 Wiz // Gravity Forms // Automatic Save & Continue | |
* | |
* Automatically save | |
* load previously saved data (via Gravity Forms' Save & Continue functionality) when a logged-in user views a form. | |
* | |
* @version 0.4 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |