Ticket #35666: 35666.2.diff
| File 35666.2.diff, 739 bytes (added by , 9 years ago) |
|---|
-
src/wp-includes/functions.php
2868 2868 ); 2869 2869 $r = wp_parse_args( $args, $defaults ); 2870 2870 2871 if ( ! headers_sent() ) {2871 if ( ! headers_sent() && null !== $r['response'] ) { 2872 2872 status_header( $r['response'] ); 2873 2873 } 2874 2874 2875 if ( is_scalar( $message ) ) 2875 2876 die( (string) $message ); 2876 2877 die( '0' ); … … 3099 3100 status_header( $status_code ); 3100 3101 } 3101 3102 echo wp_json_encode( $response ); 3102 if ( wp_doing_ajax() ) 3103 wp_die(); 3104 else 3103 3104 if ( wp_doing_ajax() ) { 3105 wp_die( '', '', array( 3106 'response' => null, 3107 ) ); 3108 } else { 3105 3109 die; 3110 } 3106 3111 } 3107 3112 3108 3113 /**