Make WordPress Core

Changeset 49918

Timestamp:
01/02/2021 08:35:01 PM (4 years ago)
Author:
TimothyBlynJacobs
Message:

REST API: Properly display JSON encoding errors.

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

Props atimmer, technosailor.
Fixes #52106.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r49787 r49918  
    531531
    532532                $result = $this->error_to_response( $json_error_obj );
    533                 $result = wp_json_encode( $result->data[0] );
     533                $result = wp_json_encode( $result->data );
    534534            }
    535535
Note: See TracChangeset for help on using the changeset viewer.