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:
@@ -149,7 +149,7 @@ class WP_Ajax_Response {
|
||||
foreach ( (array) $this->responses as $response )
|
||||
echo $response;
|
||||
echo '</wp_ajax>';
|
||||
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
|
||||
if ( wp_doing_ajax() )
|
||||
wp_die();
|
||||
else
|
||||
die();
|
||||
|
||||
Reference in New Issue
Block a user