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-shortcode-attr-field-props.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Custom Field Properties via [gravityforms] Shortcode | |
* | |
* Provide a custom "field_groups" attribute for the [gravityforms] shortcode. This allows you to modify 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 | |
/** | |
* Gravity Perks // GP Media Library // Auto-add Custom Field for File ID | |
* http://gravitywiz.com/documentation/gp-media-library/ | |
*/ | |
add_filter( 'gform_post_data', function( $data, $form, $entry ) { | |
if( ! is_callable( 'gp_media_library' ) ) { | |
return $data; | |
} |
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 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 ) { |
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 // Time Sensitive Choices | |
* | |
* Provide a drop down of times and automatically filter which choices are available based on the current time. | |
* | |
* @version 1.1 | |
* @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 // Get Form ID by Form Name | |
* | |
* @param $name string The name of the form. | |
* | |
* @return int The form ID. | |
*/ | |
function gw_get_form_id_by_name( $name ) { | |
global $wpdb; |
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 Notification Scheduler // Credit Card Expiration | |
* | |
* Send notifications based on a credit card expiration date. | |
* | |
* @version 0.1 | |
* @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 | |
/** | |
* 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-user-registration-update-by-email.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // User Registration // Update by Email | |
* | |
* Create User Registration feeds that will update the user by the submitted email address, allowing non-logged-in users |
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 // Display Price for Drop Down and Radio Button Product Fields | |
* http://gravitywiz.com/ | |
* Source: https://www.gravityhelp.com/documentation/article/gform_field_choice_markup_pre_render/#2-include-price-for-product-fields | |
*/ | |
add_filter( 'gform_field_choice_markup_pre_render', function ( $choice_markup, $choice, $field, $value ) { | |
if ( $field->type == 'product' ) { | |
$new_string = sprintf( '>%s - %s<', $choice['text'], GFCommon::to_money( $choice['price'] ) ); |
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 // Populate Form with Entry (Optionally Update Entry on Submission) | |
* | |
* Pass an entry ID and populate the form automatically. No form configuration required. Optionally update the entry on | |
* submission. | |
* | |
* @version 1.5 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |