Skip to content

Instantly share code, notes, and snippets.

@phillipwilhelm
phillipwilhelm / gp-limit-choices-daily-limit.php
Last active September 5, 2016 04:12 — forked from spivurno/gp-limit-choices-daily-limit.php
Gravity Perks // GP Limit Choices // Daily Limit
<?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
@phillipwilhelm
phillipwilhelm / bt-gravity-forms-email-csv.php
Created September 5, 2016 04:13 — forked from spivurno/bt-gravity-forms-email-csv.php
Ounce of Talent // Gravity Forms // Export Entry to CSV and Email on Submission
<?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/...
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-manual-notifications.php
Created September 5, 2016 04:13 — forked from spivurno/gw-gravity-forms-manual-notifications.php
Gravity Wiz // Gravity Forms // Send Manual Notifications
<?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+
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-user-registration-one-way-mapping.php
Created September 5, 2016 04:14 — forked from spivurno/gw-gravity-forms-user-registration-one-way-mapping.php
Gravity Wiz // Gravity Forms User Registration // One Way Mapping
<?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]>
@phillipwilhelm
phillipwilhelm / gp-preview-submission-advanced-file-uploader.php
Created September 5, 2016 04:14 — forked from spivurno/gp-preview-submission-advanced-file-uploader.php
Gravity Perks // GP Preview Submission // Adds Support for Gravity Forms Advanced File Uploader
<?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+
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-file-generator.php
Created September 5, 2016 04:15 — forked from spivurno/gw-gravity-forms-file-generator.php
Gravity Wiz // Gravity Forms // File Generator
<?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/...
@phillipwilhelm
phillipwilhelm / gp-disable-entry-creation-prevent-image-deletion-all.php
Created September 5, 2016 04:16 — forked from spivurno/gp-disable-entry-creation-prevent-image-deletion-all.php
GP Disable Entry Creation // Gravity Forms // Remove Image URLs from Entry Before Delete
/**
* 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 ) ) {
@phillipwilhelm
phillipwilhelm / gp-preview-submission-business-hours-integration.php
Created September 5, 2016 04:17 — forked from spivurno/gp-preview-submission-business-hours-integration.php
Gravity Perks // GP Preview Submission // Business Hours Integration
<?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 );
}
@phillipwilhelm
phillipwilhelm / gp-unique-id-via-dynamic-population.php
Created September 5, 2016 04:18 — forked from spivurno/gp-unique-id-via-dynamic-population.php
GP Unique ID // Gravity Perks // Populate Unique ID via Dynamic Population
<?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;
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-disable-submission-on-enter.js
Created September 5, 2016 04:18 — forked from spivurno/gw-gravity-forms-disable-submission-on-enter.js
Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter
<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;