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 // Modify Date Format for Custom Field | |
| * http://graivtywiz.com/ | |
| */ | |
| add_filter( 'gform_post_data', function( $data ) { | |
| // Update both instances of "my_date_custom_field" to your custom field name. | |
| // Update 'Y-m-d' to your desired date format. | |
| $data['post_custom_fields']['my_date_custom_field'] = date( 'Y-m-d', strtotime( $data['post_custom_fields']['my_date_custom_field'] ) ); | |
| 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
| <?php | |
| /** | |
| * Gravity Wiz // Gravity Forms Coupons // Allow Zero Amount Coupons | |
| * http://gravitywiz.com/ | |
| */ | |
| add_filter( 'gform_gravityformscoupons_feed_settings_fields', function( $settings ) { | |
| foreach( $settings as &$group ) { | |
| foreach( $group['fields'] as &$field ) { | |
| if( $field['name'] == 'couponAmountType' ) { |
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 Wiz // Gravity Forms // Map GF Checkbox Field to ACF Checkbox Field | |
| * http://graivtywiz.com/ | |
| */ | |
| add_filter( 'gform_post_data', function( $data ) { | |
| // Update "checkboxes" to your cusotm field name. | |
| $data['post_custom_fields']['checkboxes'] = serialize( explode( ',', $data['post_custom_fields']['checkboxes'] ) ); | |
| 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
| <?php | |
| /** | |
| * Gravity Perks // GP Conditional Logic Dates // Adjust User's Local Time to UTC | |
| * http://gravitywiz.com/documentation/gravity-forms-conditional-logic-dates/ | |
| */ | |
| // Update "123" to the ID of your form - or - remove to apply to all forms. | |
| add_action( 'gform_pre_render_123', function( $form ) { | |
| add_action( 'wp_footer', 'gpcld_enable_utc_timezone_script' ); | |
| add_action( 'gform_preview_footer', 'gpcld_enable_utc_timezone_script' ); | |
| function gpcld_enable_utc_timezone_script() { |
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 <david@gravitywiz.com> | |
| * @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; |