Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRO: Make [_format_your-date "D, d M y"] work with repeater #38

Closed
pwkip opened this issue Jan 3, 2020 · 1 comment
Closed

PRO: Make [_format_your-date "D, d M y"] work with repeater #38

pwkip opened this issue Jan 3, 2020 · 1 comment

Comments

@pwkip
Copy link
Owner

@pwkip pwkip commented Jan 3, 2020

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.

@pwkip

This comment has been minimized.

Copy link
Owner Author

@pwkip pwkip commented Jan 6, 2020

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);

@pwkip pwkip closed this Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.