Make WordPress Core


Ignore:
Timestamp:
08/23/2016 02:32:18 PM (8 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/class-wp-comments-list-table.php

    r37674 r38334  
    9595        $comments_per_page = $this->get_per_page( $comment_status );
    9696
    97         $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
     97        $doing_ajax = wp_doing_ajax();
    9898
    9999        if ( isset( $_REQUEST['number'] ) ) {
     
    601601
    602602            // Reply and quickedit need a hide-if-no-js span when not added with ajax
    603             if ( ( 'reply' === $action || 'quickedit' === $action ) && ! defined('DOING_AJAX') )
     603            if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() )
    604604                $action .= ' hide-if-no-js';
    605605            elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) {
Note: See TracChangeset for help on using the changeset viewer.