Skip to content

Instantly share code, notes, and snippets.

@rfmeier
Created April 27, 2022 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfmeier/9bcf9269c0168d0a39eaae77554ab47d to your computer and use it in GitHub Desktop.
Save rfmeier/9bcf9269c0168d0a39eaae77554ab47d to your computer and use it in GitHub Desktop.
WP REST json response for a WP_Error
{
"code": "name",
"message": "Name is required",
"data": {
"status": 400
},
"additional_data": [
{
"status": 400
}
],
"additional_errors": [
{
"code": "name",
"message": "A second Name error message",
"data": {
"status": 400
},
"additional_data": [
{
"status": 400
}
]
},
{
"code": "name",
"message": "A third Name error message",
"data": {
"status": 400
},
"additional_data": [
{
"status": 400
}
]
},
{
"code": "email",
"message": "Email is required",
"data": {
"status": 400
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment