Last active
April 29, 2020 06:35
-
-
Save rafaehlers/4229869d1c701e6a2825535859873c6f to your computer and use it in GitHub Desktop.
Output the timestamp of "now" for use in date comparison with [gvlogic]
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 | |
add_filter( 'gform_replace_merge_tags', function ( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) { | |
$merge_tag = '{gv_now_timestamp}'; | |
if ( strpos( $text, $merge_tag ) === false ) { | |
return $text; | |
} | |
$local_timestamp = GFCommon::get_local_timestamp( time() ); | |
//$local_date = date_i18n( 'Y-m-d', $local_timestamp, true ); | |
return str_replace( $merge_tag, $local_timestamp, $text ); | |
}, 10, 7 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment