Make WordPress Core


Ignore:
Timestamp:
08/23/2016 02:32:18 PM (9 years ago)
Author:
wonderboymusic
Message:

AJAX: add a new function, wp_doing_ajax(), which can replace... (wait for it...) DOING_AJAX checks via the constant.

Props Mte90, sebastian.pisula, swissspidy.
Fixes #25669.

File:
1 edited

Legend:

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

    r38167 r38334  
    460460
    461461        if ( $ssl && is_wp_error( $request ) ) {
    462             if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
     462            if ( ! wp_doing_ajax() ) {
    463463                trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
    464464            }
Note: See TracChangeset for help on using the changeset viewer.