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. Built from https://develop.svn.wordpress.org/trunk@38334 git-svn-id: http://core.svn.wordpress.org/trunk@38275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -94,7 +94,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
$comments_per_page = $this->get_per_page( $comment_status );
|
||||
|
||||
$doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
|
||||
$doing_ajax = wp_doing_ajax();
|
||||
|
||||
if ( isset( $_REQUEST['number'] ) ) {
|
||||
$number = (int) $_REQUEST['number'];
|
||||
@@ -600,7 +600,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
|
||||
|
||||
// Reply and quickedit need a hide-if-no-js span when not added with ajax
|
||||
if ( ( 'reply' === $action || 'quickedit' === $action ) && ! defined('DOING_AJAX') )
|
||||
if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() )
|
||||
$action .= ' hide-if-no-js';
|
||||
elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) {
|
||||
if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) )
|
||||
|
||||
Reference in New Issue
Block a user