This iterates over all error codes and messages to change it into a flat array. This enables simpler client behavior, as it is represented as a list in JSON rather than an object/map.
Parameters
$errorWP_Error
WP_Error instance.
Return
WP_REST_Response
List of associative arrays with code and message keys.
Signature, return type and hooks compared across 5 parsed releases.
5.7.0
Converted to a wrapper of rest_convert_error_to_response().from the docblock
4.4.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/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.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.