Created
August 13, 2017 11:47
-
-
Save spivurno/fb36f681a952603ccf1acebe4f5d0624 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Conditional Logic Dates // Adjust User's Local Time to UTC
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() { | |
?> | |
<script> | |
gform.addFilter( 'gpcld_enable_utc_timezone', function( enable ) { | |
return true; | |
} ); | |
</script> | |
<?php | |
} | |
return $form; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👉 This Gist has been migrated to the Gravity Wiz Snippet Library:
https://github.com/gravitywiz/snippet-library/blob/master/gp-conditional-logic-dates/gpcld-enable-utc-timezone.js