not sure what you mean exactly.. does this have anything to do with the conditional fields plugin?
Yes. As I said, if you want to use shortcodes in Contact Form 7 you should have that function. But if you have it, Conditional Fields is not working.
I’m not aware of this function, can you link me to the CF7 documentation page where you found this code?
Hi Jules.
I think there’s not any official documentation, it’s just a trick that uses a lot of people in order to use shortcodes in CF7.
By default, shortcodes are not allowed in CF7. As example, if you want to use design shortcodes you have to use that code I said in functions.php of your theme folder. Another easier example… image you have a [br] shortcode that when you use it prints the <br> tag (it doesn’t have any sense, but it’s an easy example). If you write [br] in CF7, you just will have that as a text instead of <br> (a line break). That’s the reason to use that code with the do_shortcode function.
I guess the incompatibility with “Contact Form 7 – Conditional Fields” is because you use the functions “wpcf7_add_form_tag” or “wpcf7_add_shortcode” in “cf7cf.php”, but it’s just an idea.
I hope you can fix it.
Regards and thanks for the feedback.
Hi I just tested this and it works. Make sure the shortcode exists.
Adding only this line to your functions.php file should suffice:
add_filter( 'wpcf7_form_elements', 'do_shortcode' );