diff --git src/wp-includes/load.php src/wp-includes/load.php
index e2b388fb77..bf011b1e7a 100644
|
|
|
function wp_debug_mode() { |
| 333 | 333 | error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | | if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() ) { |
| | 336 | if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() || wp_is_json_request() ) { |
| 337 | 337 | @ini_set( 'display_errors', 0 ); |
| 338 | 338 | } |
| 339 | 339 | } |
| … |
… |
function wp_finalize_scraping_edited_file_errors( $scrape_key ) { |
| 1162 | 1162 | } |
| 1163 | 1163 | echo "\n###### wp_scraping_result_end:$scrape_key ######\n"; |
| 1164 | 1164 | } |
| | 1165 | |
| | 1166 | /** |
| | 1167 | * Check whether current request is Content-Type: application/json |
| | 1168 | * |
| | 1169 | * @since 5.0.0 |
| | 1170 | * |
| | 1171 | * @return bool True if Content-Type header is application/json, false otherwise |
| | 1172 | */ |
| | 1173 | function wp_is_json_request() { |
| | 1174 | |
| | 1175 | return ( isset( $_SERVER['CONTENT_TYPE'] ) && 'application/json' === $_SERVER['CONTENT_TYPE'] ); |
| | 1176 | |
| | 1177 | } |