mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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
This commit is contained in:
parent
33cb202f07
commit
c56eb69d7d
wp-includes
@ -530,7 +530,7 @@ class WP_REST_Server {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$result = $this->error_to_response( $json_error_obj );
|
$result = $this->error_to_response( $json_error_obj );
|
||||||
$result = wp_json_encode( $result->data[0] );
|
$result = wp_json_encode( $result->data );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $jsonp_callback ) {
|
if ( $jsonp_callback ) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user