Ticket #42061: 42061.diff
File 42061.diff, 3.1 KB (added by , 6 years ago) |
---|
-
src/wp-admin/includes/ms.php
45 45 $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' ); 46 46 } 47 47 48 if ( $file['error'] != '0' && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) {48 if ( '0' != $file['error'] && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() && ! wp_is_rest_request() ) { 49 49 wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' ); 50 50 } 51 51 -
src/wp-includes/class-wp-query.php
946 946 $this->is_comment_feed = true; 947 947 } 948 948 949 if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots ) ) {949 if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || wp_is_rest_request() || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots ) ) { 950 950 $this->is_home = true; 951 951 } 952 952 -
src/wp-includes/functions.php
6438 6438 } 6439 6439 } 6440 6440 } 6441 6442 /** 6443 * Determines whether the current request is a WordPress REST API request. 6444 * 6445 * This function must not be called until the {@see 'parse_request'} action. 6446 * 6447 * @since 5.0.0 6448 * 6449 * @return bool True if it's a WordPress REST API request, false otherwise. 6450 */ 6451 function wp_is_rest_request() { 6452 if ( ! defined( 'REST_REQUEST' ) && ! did_action( 'parse_request' ) ) { 6453 _doing_it_wrong( 6454 __FUNCTION__, 6455 sprintf( 6456 /* translators: %s: parse_request */ 6457 __( 'Detecting whether the current request is a REST API request is not possible until the %s hook.' ), 6458 '<code>parse_request</code>' 6459 ), 6460 '5.0.0' 6461 ); 6462 } 6463 6464 /** 6465 * Filters whether the current request is a WordPress REST API request. 6466 * 6467 * @since 5.0.0 6468 * 6469 * @param bool $wp_is_rest_request Whether the current request is a WordPress REST API request. 6470 */ 6471 return apply_filters( 'wp_is_rest_request', defined( 'REST_REQUEST' ) && REST_REQUEST ); 6472 } -
src/wp-includes/load.php
349 349 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 ); 350 350 } 351 351 352 if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING) || wp_doing_ajax() ) {352 if ( defined( 'XMLRPC_REQUEST' ) || wp_installing() || wp_doing_ajax() ) { 353 353 @ini_set( 'display_errors', 0 ); 354 354 } 355 355 }