Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/fb36f681a952603ccf1acebe4f5d0624 to your computer and use it in GitHub Desktop.
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
<?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