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 Unique ID // Exclude Unique ID Fields from Gravity PDF | |
| * http://gravityperks.com | |
| */ | |
| add_filter( 'gform_form_post_get_meta', function( $form ) { | |
| foreach( $form['fields'] as &$field ) { | |
| if( $field->get_input_type() == 'uid' ) { | |
| $field->cssClass = 'exclude'; | |
| } |
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 Unique ID // HyperDB Support for Sequential IDs | |
| * http://gravitywiz.com/documentation/gravity-forms-unique-id/ | |
| */ | |
| add_filter( 'gpui_sequential_unique_id_pre_insert', function( $uid, $form_id, $field_id, $starting_number) { | |
| global $wpdb; | |
| $wpdb->query( 'START TRANSACTION' ); |
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 // Better Inventory // Limit by ACF Custom Field | |
| * https://gravitywiz.com/better-inventory-with-gravity-forms/ | |
| */ | |
| add_filter( 'wp', function() { | |
| if( function_exists( 'get_field' ) ) { | |
| $gwinv = new GW_Inventory( array( | |
| 'form_id' => 123, | |
| 'field_id' => 1.3, |
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 | |
| /** | |
| * -------------------------------------------------------------------------- | |
| * IMPORTANT! | |
| * This snippet has been superceded by the Choice Counter snippet. | |
| * https://gist.github.com/spivurno/00af5ee7e21dd5d6903fbae6fecd85ce | |
| * -------------------------------------------------------------------------- | |
| * | |
| * Gravity Wiz // Gravity Forms // Checkbox Count | |
| * |
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 eCommerce Fields // Deduct Deposit from Order Summary | |
| * http://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/ | |
| */ | |
| add_action( 'wp_loaded', function() { | |
| if( ! function_exists( 'gp_ecommerce_fields' ) ) { | |
| return; | |
| } |
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
| /** | |
| * Gravity Perks // Lock // Simple Locking System to Prevent Concurrent Actions | |
| * http://gravitywiz.com./ | |
| */ | |
| class GP_Lock { | |
| private $id; | |
| public function __construct( $id = false ) { |
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
| /** | |
| * Gravity Perks // GP Limit Choices // Prevent Concurrent Submissions from Consuming the Last Choice | |
| * http://gravitywiz.com/documentation/gravity-forms-limit-choices/ | |
| */ | |
| add_action( 'gform_validation', 'gplc_lock', 99 ); | |
| function gplc_lock ( $result ) { | |
| $is_last_page = GFFormDisplay::get_target_page( $result['form'], GFFormDisplay::get_source_page( $result['form']['id'] ), rgpost( 'gform_field_values' ) ) == '0'; | |
| $lock = new GP_Lock( 'gplc-lock' ); |
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
| <script> | |
| gform.addAction( 'gpcp_after_update_pricing', function( triggerFieldId, gpcp ) { | |
| ( function( $ ) { | |
| $( 'label[data-gpcp-template], option[data-gpcp-template]' ).each( function() { | |
| var $priceElem = $( this ).is( 'option' ) ? $( this ) : $( this ).siblings( 'input' ), | |
| price = gformFormatMoney( $priceElem.val().split( '|' )[1] ), | |
| template = $( this ).attr( 'data-gpcp-template' ); | |
| $( this ).html( template.replace( '{price}', price ) ); | |
| } ); | |
| } )( jQuery ); |
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/gravity-forms/gw-check-in.php | |
| */ | |
| /** | |
| * Gravity Wiz // Gravity Forms // Check-In | |
| * | |
| * "Check-in" for Gravity Forms products. |
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 Unique ID // Use Unique ID as User Registration Password | |
| * http://gravitywiz.com/documentation/gravity-forms-unique-id/ | |
| */ | |
| add_filter( 'gform_userregistration_feed_settings_fields', function( $fields, $form ) { | |
| foreach( $fields['user_settings']['fields'] as &$field ) { | |
| if( $field['name'] == 'password' ) { | |
| $field['args']['input_types'][] = 'uid'; |