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 Choices // Daily Limit | |
* | |
* By default, GP Limit Choices limits choices forever. This snippet will allow you to make that limit apply only to the current day. | |
* | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravityperks.com | |
* @copyright 2015 Gravity Wiz |
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 | |
/** | |
* Ounce of Talent // Gravity Forms // Export Entry to CSV and Email on Submission | |
* | |
* This snippet will export the entry to CSV format, email that CSV file to a specified email address, and then delete the entry. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.com/... |
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 // Send Manual Notifications | |
* | |
* Provides a custom notification event that allows you to create notifications that can be sent | |
* manually (via Gravity Forms "Resend Notifications" feature). | |
* | |
* @version 1.2 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |
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 User Registration // One Way Mapping | |
* | |
* By default, fields mapped to a user meta key on an User Registration Update Feed will be populated with the current | |
* user meta value. This snippet allows you to specify form fields that should update the user meta but not be populated | |
* with the existing value when the form is rendered. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> |
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 Preview Submission // Adds Support for Gravity Forms Advanced File Uploader | |
* | |
* By default, AFU does not provide any merge tags for displaying the files in Notifications and Confirmations. This | |
* snippet provides these merge tags and also makes them available prior to submission. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |
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 // File Generator | |
* | |
* Generate a file on submission which will be processed for merge tags. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.com/... |
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
/** | |
* GP Disable Entry Creation // Gravity Forms // Prevent Image Deletion (for all forms) | |
* | |
* GF will go through an entry when it is deleted and remove all of the files associated with that entry. We can bypass | |
* this by removing the image URLs from the entry prior to deleting it. | |
*/ | |
add_action( 'gform_after_submission', function( $entry, $form ) { | |
$fields = GFCommon::get_fields_by_type( $form, array( 'fileupload', 'post_image' ) ); | |
if( ! is_array( $fields ) ) { |
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 Preview Submission // Business Hours Integration | |
*/ | |
add_filter( 'gform_merge_tag_filter', function( $value, $input_id, $modifier, $field, $raw_value ) { | |
if( $field->type == 'business_hours' ) { | |
$value = GFBusinessHours::display_entry_field_value( $value, $field ); | |
} |
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 | |
/** | |
* GP Unique ID // Gravity Perks // Populate Unique ID via Dynamic Population | |
*/ | |
add_filter( 'gform_field_value_uid', function( $value, $field ) { | |
if( function_exists( 'gp_unique_id' ) ) { | |
$field[ gp_unique_id()->key( 'length' ) ] = 9; | |
$value = gp_unique_id()->get_unique( $field->formId, $field ); | |
} | |
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
<script type="text/javascript"> | |
/** | |
* Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter | |
* http://gravitywiz.com/disable-submission-when-pressing-enter-for-gravity-forms/ | |
*/ | |
jQuery(document).on( 'keypress', '.gform_wrapper', function (e) { | |
var code = e.keyCode || e.which; | |
if ( code == 13 && ! jQuery( e.target ).is( 'textarea,input[type="submit"],input[type="button"]' ) ) { | |
e.preventDefault(); | |
return false; |