WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Contact Form 7] Form won't display within ajax request response-wp_ajax

[Plugin: Contact Form 7] Form won't display within ajax request response-wp_ajax

  • I’m trying to display contact form from ajax request response:

    function my_ajax_get_content()
    {
    	echo do_shortcode(apply_filters("the_content", "[contact-form-7 id='808' title='Contact form 1']"));
    	exit();
    }
    add_action("wp_ajax_nopriv_get_content", my_ajax_get_content");

    But the form won’t render. On the page I can see just raw shortcode: [contact-form-7 id=”808″ title=”Contact form 1″]

    If I place echo do_shortcode("[contact-form-7 id='808' title='Contact form 1']"); for example in footer.php, then it works.

    What should I do to render the shortcode within ajax request response?

    http://wordpress.org/extend/plugins/contact-form-7/

  • The topic ‘[Plugin: Contact Form 7] Form won't display within ajax request response-wp_ajax’ is closed to new replies.