This file contains 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 | |
add_filter("gform_pre_render", "populate_dropdown"); | |
function populate_dropdown($form){ | |
global $current_user; | |
get_currentuserinfo(); | |
foreach($form['fields'] as &$field) { | |
if($field['inputName'] == 'email') { | |
This file contains 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
/** | |
* Populate Date: Year from Current Date | |
*/ | |
add_filter('gform_field_value_year_from_date', 'gw_year_from_date'); | |
function gw_year_from_date() { | |
return date('m/d/Y', strtotime('+1 year')); | |
} |
This file contains 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 | |
/** | |
* Populate Date: Year from Current Date | |
*/ | |
add_filter('gform_field_value_year_from_date', 'gw_year_from_date'); | |
function gw_year_from_date() { | |
return date('Y-m-d', strtotime('+1 year')); | |
} |
This file contains 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 | |
/** | |
* Conditional Confirmations (with Merge Tag Support) | |
* http://gravitywiz.com/2012/08/18/conditional-confirmations/ | |
* | |
* Provides the ability to register conditional confirmations. To register a new conditional confirmation | |
* use the GWConditionalConfirmations::add_conditional_confirmation() function. | |
* | |
* GWConditionalConfirmations::add_conditional_confirmation($form_id, $field_id, $operator, $value, $confirmation); |
This file contains 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 | |
// example for form ID 7 where the confirmation will redirect the user to http://google.com if the value of field ID 3 is less than 10 | |
GWConditionalConfirmations::add_conditional_confirmation(7, 3, 'less_than', 10, array('redirect' => 'http://google.com')); | |
// example for form ID 5 where a text confirmation will be displayed if field ID 2 is equal to "Virginia" | |
GWConditionalConfirmations::add_conditional_confirmation(5, 2, 'is', 'Virginia', 'Confirmed! You are from Virginia!'); | |
// example for form ID 11 where the confirmation will redirect to the WordPress page ID 12 if the value of field ID 4 is greater than 500 | |
GWConditionalConfirmations::add_conditional_confirmation(11, 4, 'greater_than', 500, array('page' => 12)); |
This file contains 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/gravity-forms/gw-better-pre-submission-confirmation.php | |
*/ | |
/** | |
* Better Pre-submission Confirmation | |
* http://gravitywiz.com/2012/08/04/better-pre-submission-confirmation/ | |
*/ |
This file contains 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 | |
/** | |
* Require All Columns of List Field | |
* http://gravitywiz.com/2012/07/23/require-all-columns-of-list-field/ | |
*/ | |
add_filter('gform_validation', 'gwiz_require_all_list_columns'); | |
function gwiz_require_all_list_columns($validation_result) { | |
This file contains 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/gravity-forms/gw-random-fields.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Random Fields | |
* | |
* Randomly display a specified number of fields on your form. |
This file contains 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 | |
/** | |
* Limit How Many Checkboxes Can Be Checked | |
* http://gravitywiz.com/2012/06/11/limiting-how-many-checkboxes-can-be-checked/ | |
*/ | |
class GFLimitCheckboxes { | |
public static $field_limits; |
This file contains 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 // Set Number of List Field Rows by Field Value | |
* | |
* Add/remove list field rows automatically based on the value entered in the specified field. Removes the add/remove | |
* that normally buttons next to List field rows. | |
* | |
* @version 1.3 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |
OlderNewer