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:
Scott Taylor
2016-08-23 14:33:30 +00:00
parent 6f9f3b0c56
commit b7812bd416
15 changed files with 38 additions and 21 deletions

View File

@@ -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();