PRO: Make [_format_your-date "D, d M y"] work with repeater
pwkip opened this issue · 1 comments
Based on the CF7 documentation (https://contactform7.com/date-field/) it is possible to format the [date] in the email using [_format_your-date "D, d M y"], but this is not working inside [repeater] fields :'(
The string in the email i get is: [_format_your-date "D, d M y"__1].
It seems that the logic adds __1 to the [], but that fails to format the string in the mail. I've played adding the "D, d M y" before ["D, d M y" _format_your-date], but same result.
It works however if I use [_format_your-date] inside [repeater], but that just outputs the default value. Outside of repeater, date fields are formatted as expected.
Hope you manage to fix the issues, as I need it for my client's reservation form.
temporary fix: replace line 56 in wp-content/plugins/contact-form-7-conditional-fields-pro/Wpcf7cfMailParser.php
echo str_replace(']','__'.$i.']',$str);
with this:
echo preg_replace("/[([^\s^\]]?)([\s]]+)([^\]]?)/", "[$1__{$i}$2",$str);