Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Multiple errors via param validation should be programmatically readable #1143

@joehoyle

Description

@joehoyle

Currently if a request contains multiple invalid request args, we compile an error string showing all the issues. However, we don't pass all the different fields that errored. From @rmccue in slack:

new WP_Error( 'json_missing_field', 'Missing $field', array( 'key' => $field ) )
Would output as [ { "code": "json_missing_field", "message": "Missing abc", "data": { "key": "abc" } }]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions