Make WordPress Core


Ignore:
Timestamp:
08/23/2016 02:32:18 PM (10 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-includes/functions.php

    r38308 r38334  
    25712571        }
    25722572
    2573         if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
     2573        if ( wp_doing_ajax() ) {
    25742574                /**
    25752575                 * Filters the callback for killing WordPress execution for Ajax requests.
     
    30653065        @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
    30663066        echo wp_json_encode( $response );
    3067         if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
     3067        if ( wp_doing_ajax() )
    30683068                wp_die();
    30693069        else
Note: See TracChangeset for help on using the changeset viewer.