diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 1693c13e7f..60dd4bda3c 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3250,9 +3250,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 *