This code below is taking precedence over my custom functions, so get_locale() and translation functions __() are no longer working. I'm using Polylang free version, and I basically create a form for each language and then add it to the page. So for example when I am on a French page, I add the French contact form shortcode.
Here's the most recent CF7 code causing the issue:
I'm doing some workarounds like so but I still have issues with _() translation functions. And I'm not only using it in wpcf7_form_hidden_fields hook, also in wpcf7_init to create custom tags, wpcf7_add_form_tag.
Is this the proper way to pull the language from the form and not instead from the actual page so it matches the page language? If is the way, can I somehow hook into to change the locale? Thank you.
Hi,
This code below is taking precedence over my custom functions, so get_locale() and translation functions __() are no longer working. I'm using Polylang free version, and I basically create a form for each language and then add it to the page. So for example when I am on a French page, I add the French contact form shortcode.
Here's the most recent CF7 code causing the issue:
Here's what fixes the issue:
I'm doing some workarounds like so but I still have issues with _() translation functions. And I'm not only using it in wpcf7_form_hidden_fields hook, also in wpcf7_init to create custom tags, wpcf7_add_form_tag.
Is this the proper way to pull the language from the form and not instead from the actual page so it matches the page language? If is the way, can I somehow hook into to change the locale? Thank you.