Changeset 38576
- Timestamp:
- 09/08/2016 01:44:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r38518 r38576 3102 3102 * @param int $status_code The HTTP status code to output. 3103 3103 */ 3104 function wp_send_json( $response, $status_code = 200) {3104 function wp_send_json( $response, $status_code = null ) { 3105 3105 @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) ); 3106 status_header( $status_code ); 3106 if ( null !== $status_code ) { 3107 status_header( $status_code ); 3108 } 3107 3109 echo wp_json_encode( $response ); 3108 3110 if ( wp_doing_ajax() ) … … 3121 3123 * @param int $status_code The HTTP status code to output. 3122 3124 */ 3123 function wp_send_json_success( $data = null, $status_code = 200) {3125 function wp_send_json_success( $data = null, $status_code = null ) { 3124 3126 $response = array( 'success' => true ); 3125 3127 … … 3145 3147 * @param int $status_code The HTTP status code to output. 3146 3148 */ 3147 function wp_send_json_error( $data = null, $status_code = 200) {3149 function wp_send_json_error( $data = null, $status_code = null ) { 3148 3150 $response = array( 'success' => false ); 3149 3151
Note: See TracChangeset
for help on using the changeset viewer.