HI sorry for the bad English…
I would like to display the contact form 7 shortcode dynamic on the theme. I already add a Textarea in woocommerce Here my code:
$enquiry_form_settings[] = array (
'id' => 'we_enquiry_form_textarea',
'name' => __( 'Add Contact Form 7 Shortcodes', 'we-extra-extension' ),
'type' => 'textarea',
'css' => 'min-height:200px',
'placeholder' => 'Add Contact Form 7 Enquiry Form Shortcodes',
'label' => __('Custom Contact Form 7 Shortcode', 'extra-extension')
);
Textarea working perfectly But I am facing a problem to display contact form 7 shortcode, please someone helps me
Here display code :
function demo_text () {
if ( get_option ('enquiry_form_textarea') && get_option ( 'enquiry_form_textarea')){
echo do_shortcode( ['cform_shortcode']);
}
}
add_action( 'woocommerce_after_add_to_cart_button', 'demo_text' );
Thanks all
See this page about format value filters, it has an example of using shortcode in fields other than wysiwyg fields https://www.advancedcustomfields.com/resources/acf-format_value/