Skip to content

Commit

Permalink
General: Only use _jsonp_wp_die_handler() for JSONP REST API requests.
Browse files Browse the repository at this point in the history
Props mdawaffe, peterwilsoncc.

git-svn-id: https://develop.svn.wordpress.org/trunk@51740 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Sep 8, 2021
1 parent 4f4c344 commit ca4765c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/functions.php
Expand Up @@ -3557,9 +3557,9 @@ function wp_die( $message = '', $title = '', $args = array() ) {
* @param callable $function Callback function name.
*/
$function = apply_filters( 'wp_die_json_handler', '_json_wp_die_handler' );
} elseif ( wp_is_jsonp_request() ) {
} elseif ( defined( 'REST_REQUEST' ) && REST_REQUEST && wp_is_jsonp_request() ) {
/**
* Filters the callback for killing WordPress execution for JSONP requests.
* Filters the callback for killing WordPress execution for JSONP REST requests.
*
* @since 5.2.0
*
Expand Down

0 comments on commit ca4765c

Please sign in to comment.