関数 wp_send_json()
定義ファイル :/blog/wp-includes/functions.php 13
wp_send_json()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /** * Send a JSON response back to an Ajax request. * * @since 3.5.0 * * @param mixed $response Variable (usually an array or object) to encode as JSON, * then print and die. */ function wp_send_json( $response ) { @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) ); echo json_encode( $response ); if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) wp_die(); else die; } |