Home›Support›English Support›[Resolved] Failing to get CF7_get_current_var key='title' with a WPML translated form
[Resolved] Failing to get CF7_get_current_var key='title' with a WPML translated form
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing an issue with translating a Contact Form 7 form using WPML. The form includes a dynamic hidden field to capture the page title, which works in the original language but not in the translated Italian version. Solution: 1. Navigate to Contact -> Contact Forms. 2. Use the top admin bar to switch the language. 3. Edit the translated form. 4. Add the dynamic hidden field:
5. Update the translated form. After completing these steps, verify if the translated form correctly captures the page title.
If this solution does not apply to your situation, or if it's outdated, we recommend opening a new support ticket. We also highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Hallo, I have successfully used WPML to translate the website from the main language (English) into Italian, including forms made with Contact Form 7.
However I am still facing a minor issue when using the wpml translation plugin to translate a "contact form 7" plugin. The form includes a hidden field to get the page title, which works fine in the original language:
However, when the form is called from the Italian page and the mail is sent, the page title is not getting assigned to the 'title' key, so we just get the unassigned "title" string.
May you please suggest where to look for this issue ?
Thanks for contacting WPML forums support. I'll be glad to help you today.
1) First of all, sorry for the late reply; it was due to a higher workload. Please login to this sandbox site and create a test form. (hidden link)
After that, please translate this form to replicate the issue. If it is replicable, please let me know how to reproduce it.
2) It's unrelated to the issue, but according to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. The minimum requirements for WPML are 128 MB. (Kindly check this page https://wpml.org/home/minimum-requirements/)
You can increase it by adding the following code in your wp-config.php file right before the /* That's all, stop editing! Happy publishing. */ line:
Hallo Osama,
thanks for your reply and providing me with a ready to use sandbox.
I have installed the required plugins and replicated a basic sample made of a page containing a Contact form 7, then translated both of them, which reflects our actual configuration.
The page are named as TEST PAGE ENGLISH and TEST PAGE ITALIAN - which is the data assigned to cf7s-application field from the "CF7_get_current_var key='title'" and used for the email body and email subject.
Everything is working and the issue is being replicated as you can see from the received emails from the attached picture, only the original English page is working while on the Italian translation the title value is not assigned to cf7s-application.
Hopefully you can sort out the issue and let me know a solution.
Thank you for your support
Kindest Regards
Antonio Cristiani
1- Go to Contact-> Contact Forms
2- Switch the language from the top admin bar
3- Edit the translated form
4- Add the field
5- Update the translated form
After that, please check if the translated form works as it should.
In fact I didn't notice the hidden field in the form template was wrongly translated, I just copied the row from the English form and everything is working fine now.