General: Only use `_jsonp_wp_die_handler()` for JSONP REST API requests.

Props mdawaffe, peterwilsoncc.
Built from https://develop.svn.wordpress.org/trunk@51740


git-svn-id: http://core.svn.wordpress.org/trunk@51348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-09-08 17:16:57 +00:00
parent 1105ddf965
commit e1e1d021ea
2 changed files with 3 additions and 3 deletions

View File

@ -3557,9 +3557,9 @@ function wp_die( $message = '', $title = '', $args = array() ) {
* @param callable $function Callback function name. * @param callable $function Callback function name.
*/ */
$function = apply_filters( 'wp_die_json_handler', '_json_wp_die_handler' ); $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 * @since 5.2.0
* *

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.9-alpha-51739'; $wp_version = '5.9-alpha-51740';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.