Last active
January 18, 2023 07:08
-
-
Save kaskad88/eb35ae49f312d95746b13d3fde25d0f1 to your computer and use it in GitHub Desktop.
This file contains 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
add_filter( 'do_shortcode_tag', function ( $output, $tag, $attr ) { | |
if ( 'jet_engine' !== $tag ) { | |
return $output; | |
} | |
if ( empty( $attr['component'] ) || 'meta_field' !== $attr['component'] ) { | |
return $output; | |
} | |
$date_keys = array( 'feastday', 'date_field_1', 'date_field_2' ); // date fields list | |
if ( empty( $attr['field'] ) || ! in_array( $attr['field'], $date_keys ) ) { | |
return $output; | |
} | |
if ( empty( $output ) ) { | |
return $output; | |
} | |
$format = get_option( 'date_format' ); // or set custom date format. Ex.: $format = 'F j, Y'; | |
$output = date_i18n( $format, $output ); | |
return $output; | |
}, 10, 3 ); |
@kaskad88 Currently "Save as timestamp" option is ON for both fields, earlier when option was OFF it was showing correctly in mails.
I have tried and tested after adding this code, still showing in same format. This form is created using JetFormBuilder.
@codeintopixel Could you please attach a screen with your email template in JetFormBuilder https://tppr.me/4eT8f
Here you go @kaskad88
@codeintopixel for your case the code is above not needed.
Replace the string %customer-due-date%
on %customer-due-date|format_date%
in the content field.
This worked, one typo here though instead of hypen(-) we have to use underscore(_). As this is what macros accepting in form builder. Thank you for your quick responses. 👯
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@codeintopixel According to the code, you did everything correctly