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_action( 'init', function() { | |
$gplc_form_id = 123; | |
$gplc_field_id = 4; | |
if( is_callable( 'gp_limit_choices' ) ) { | |
add_filter( "gform_pre_process_{$gplc_form_id}", function( $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 | |
/** | |
* Gravity Wiz // Gravity Forms // Set Entry's "created_by" Property to Field Value | |
* | |
* Can be used in combination with the [GW Populate Users](https://gist.github.com/spivurno/03205e87b8196b5a87cd) snippet | |
* to set the selected user as the creator of the entry. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |
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 // Double Confirmation Fields | |
* | |
* Require a field's value to be entered twice to confirm it. | |
* | |
* @version 0.3 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.com/custom-field-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 | |
/** | |
* Gravity Perks // GP Limit Choices // Field Group | |
* | |
* Specify a group of fields that should create a unique choice to limited. For example, a Date field and Radio Button field could be | |
* combined to sell x tickets per date where the ticket type is controlled by the Radio Button field and the date is | |
* selected in the Date field. | |
* | |
* @version 1.3 | |
* @author David Smith <[email protected]> |
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 // Rounding by Increment | |
* | |
* Provides a variety of rounding functions for Gravity Form Number fields powered by the CSS class setting for each field. Functions include: | |
* | |
* + rounding to an increment (i.e. increment of 100 would round 1 to 100, 149 to 100, 150 to 200, etc) | class: 'gw-round-100' | |
* + rounding up by an increment (i.e. increment of 50 would round 1 to 50, 51 to 100, 149 to 150, etc) | class: 'gw-round-up-50' | |
* + rounding down by an increment (i.e. increment of 25 would round 1 to 0, 26 to 25, 51 to 50, etc) | class: 'gw-round-down-25' | |
* + rounding up to a specific minimum (i.e. min of 50 would round 1 to 50, 51 and greater would not be rounded) | class: 'gw-round-min-50' |
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/require-all-columns-of-list-field/ | |
*/ | |
class GWRequireListColumns { | |
private $field_ids; | |
public static $fields_with_req_cols = array(); |
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 // Calculated Shipping | |
* | |
* A simple method for using a calculated product field as a shipping field. This provides the ability to use | |
* calculations when determining a shipping price. | |
* | |
* @version 1.2 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |
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.1 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |
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
<!-- | |
Gravity Perks // GP Copy Cat // Copy Label (instead of Value) | |
http://gravitywiz.com/documentation/gravity-forms-copy-cat/ | |
Instructions: | |
1. Add an HTML field to your form. | |
2. Copy and paste the entire contents of this snippet into the "Content" field setting. | |
--> | |
<script> | |
gform.addFilter( 'gppc_copied_value', function( value, $elem, data, sourceValues ) { |
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 Perks // Nested Forms // Force {Parent} Merge Tag Replacement on Submission | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
add_filter( 'gform_entry_post_save', function ( $entry, $form ) { | |
$pattern = '/{Parent\:(.+)}/i'; | |
foreach ( $form['fields'] as &$field ) { | |
if ( $field->get_input_type() == 'form' ) { |
NewerOlder