Last active
January 18, 2023 07:08
-
-
Save kaskad88/eb35ae49f312d95746b13d3fde25d0f1 to your computer and use it in GitHub Desktop.
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
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 ); |
@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
Here you go @kaskad88