REST API: Properly display JSON encoding errors.

Previously `null` was returned because the server was accessing the incorrect variable.

Props atimmer, technosailor.
Fixes #52106.


git-svn-id: https://develop.svn.wordpress.org/trunk@49918 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Timothy Jacobs
2021-01-02 20:35:01 +00:00
parent 85c8cca7d1
commit 2206495007

View File

@@ -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 ) {