Skip Navigation

[Resolved] do_shortcode muiltiple cred_form problem with WPML

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 5 months ago.

Assisted by: Waqar.

Author
Posts
#2668605

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

#2668799

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

#2669161

Hi Waqar,
thanks for the info. Could you give me an example of usage?
Regards

#2669533

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.