S
S
sergeyviktorovich2021-11-10 20:13:06
WordPress
sergeyviktorovich, 2021-11-10 20:13:06

Why did Wordpress cut out the form tag when inserting a shortcode?

add_action( 'woocommerce_single_variation', 'product_mail', 11 );
function product_mail(){
    echo "<div class='mail-form-wrap'>".do_shortcode("[mailpoet_form id='1']")."</div>";

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2021-11-10
@sergeyviktorovich

Because you are trying to nest a form within a form, here you hang your form
https://github.com/woocommerce/woocommerce/blob/aa...
but if you look at line 28, you will see that the form is already open there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question