From c56eb69d7d337aa3a8f9ac7d1a449d85163c1a5e Mon Sep 17 00:00:00 2001 From: TimothyBlynJacobs Date: Sat, 2 Jan 2021 20:36:06 +0000 Subject: [PATCH] REST API: Properly display JSON encoding errors. Previously `null` was returned because the server was accessing the incorrect variable. Props atimmer, technosailor. Fixes #52106. Built from https://develop.svn.wordpress.org/trunk@49918 git-svn-id: http://core.svn.wordpress.org/trunk@49617 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-server.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 7e28478d4d..a692d2304e 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -530,7 +530,7 @@ class WP_REST_Server { ); $result = $this->error_to_response( $json_error_obj ); - $result = wp_json_encode( $result->data[0] ); + $result = wp_json_encode( $result->data ); } if ( $jsonp_callback ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 866f712737..4879039944 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-49917'; +$wp_version = '5.7-alpha-49918'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.