diff options
author | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2021-09-08 17:22:10 +0000 |
---|---|---|
committer | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2021-09-08 17:22:10 +0000 |
commit | a6d8e945e7c484bbc69c5f2276529beb8c5305e1 (patch) | |
tree | d7875ea9f2f5b92d44ddbfbcc55df2bec61495c5 | |
parent | c8a4205394819839ee33fad040d24a4fd355cb23 (diff) | |
download | wordpress-a6d8e945e7c484bbc69c5f2276529beb8c5305e1.tar.gz wordpress-a6d8e945e7c484bbc69c5f2276529beb8c5305e1.zip |
General: Only use `_jsonp_wp_die_handler()` for JSONP REST API requests.
Props mdawaffe, peterwilsoncc.
Merges [51740] to the 5.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/5.7@51742 602fd350-edb4-49c9-b593-d223f7449a82
-rw-r--r-- | src/wp-includes/functions.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 5935f781fb..051e16c9ba 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3376,9 +3376,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 * |