do_shortcode über Ajax

Ich versuche, contact-form-7 über Ajax mit do_shortcode anzurufen. Aber es zeigt nur “shortcode code”.

function example_ajax_request() { // The $_REQUEST contains all the data sent via ajax if ( isset($_REQUEST) ) { $shortcode = do_shortcode("[contact-form-7 id='900' title='Email Us']"); echo apply_filters('the_content', $shortcode); die; } add_action( 'wp_ajax_example_ajax_request', 'example_ajax_request' ); add_action( 'wp_ajax_nopriv_example_ajax_request', 'example_ajax_request' ); add_action( 'init', create_function('', 'register_shortcode_ajax( "example_ajax_request", "example_ajax_request" ); ')); function register_shortcode_ajax( $callable, $action ) { if ( empty( $_GET['action'] ) || $_GET['action'] != $action ) return; call_user_func( $callable ); } 

Ich überprüfe es mit sueurl / wp-admin / admin-ajax.php? Action = beispiel_ajax_request & ajax = true & width = 600 & height = 300 und siehe [contact-form-7 id = ‘900’ title = ‘Email Us’] Inhalt.

Solutions Collecting From Web of "do_shortcode über Ajax"