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-includes/pluggable.php

    r38286 r38334  
    604604
    605605    // Allow a grace period for POST and Ajax requests
    606     if ( defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD'] ) {
     606    if ( wp_doing_ajax() || 'POST' == $_SERVER['REQUEST_METHOD'] ) {
    607607        $expired += HOUR_IN_SECONDS;
    608608    }
     
    11051105
    11061106    if ( $die && false === $result ) {
    1107         if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
     1107        if ( wp_doing_ajax() ) {
    11081108            wp_die( -1 );
    11091109        } else {
Note: See TracChangeset for help on using the changeset viewer.