wp-includes/rest-api/class-wp-rest-server.php:232Retrieves an appropriate error representation in JSON.
$codestring$messagestring$statusintoptionalnullstring protected function json_error( $code, $message, $status = null ) { if ( $status ) { $this->set_status( $status ); } $error = compact( 'code', 'message' ); return wp_json_encode( $error ); }Introduced in 4.4.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$status retyped from int to int|null.verified against sourcesrc/wp-includes/rest-api/class-wp-rest-server.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.