WordPress.org

Make WordPress Core

Changeset 36571


Ignore:
Timestamp:
02/18/2016 04:42:48 PM (4 years ago)
Author:
ocean90
Message:

Don't display errors during Ajax requests.

See #34915 for REST and #23811 for XML-RPC.

Props pento.
Fixes #26262.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r36530 r36571  
    280280 * directory.
    281281 *
    282  * Errors are never displayed for XML-RPC requests.
     282 * Errors are never displayed for XML-RPC, REST, and Ajax requests.
    283283 *
    284284 * @since 3.0.0
     
    301301        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 );
    302302    }
    303     if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) ) {
     303
     304    if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
    304305        ini_set( 'display_errors', 0 );
    305306    }
Note: See TracChangeset for help on using the changeset viewer.