WPDev.one
Core Function
View Source on Trac ↗

rest_convert_error_to_response()

rest_convert_error_to_response( mixed $error )

Converts an error to a response object.

Parameters 1 required

Name / Type Description
$error
WP_Error

WP_Error instance.

Required

Return Value

(WP_REST_Response)
List of associative arrays with code and message keys.

Function Information

Since Version
5.7.0
Source File
wp-includes/rest-api.php
Advertisement