Hi,
I am creating a new site where I have several cred_forms loaded into a page via a custom function. The cred_forms are loaded via the do_shortcode function. Now I had to create a translation for these cred_forms via WPML and I notice that the translations are not loading correctly. If I activate one at a time there is no problem but if I enter more than one the translation does not work correctly and the correct fields are not taken. How can I fix this?
Regards
Hi,
Thank you for contacting us and I'd be happy to assist.
Y can include these forms inside a content template and then load it as a whole through the content template shortcode or through the PHP function:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
https://toolset.com/documentation/programmer-reference/views-api/#render_view_template
The goal is to make sure those forms are passed through the 'the_content' filter so that they can be properly processed by WPML for translation.
regards,
Waqar
Hi Waqar,
thanks for the info. Could you give me an example of usage?
Regards
Yes, please create a content template named 'Test CT'.
Next, include all the Toolset Forms that you need to load, in this content template.
And in your custom function, where you are loading individual forms, you can load this new content template, like this:
( ref: https://toolset.com/documentation/programmer-reference/views-api/#render_view_template )
echo render_view_template( 123 );
Note: You'll replace 123 with the actual ID of this test content template.