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.

Validate request arguments before passing to the controller #871

@danielbachhuber

Description

@danielbachhuber

If a client provides an invalid format when creating or updating a Post, the current behavior is to:

  1. Create the post with all other supplied details.
  2. Silently fail setting the post format (we create a WP_Error but don't do anything with it).

See https://github.com/WP-API/WP-API/blob/develop/lib/class-wp-json-posts-controller.php#L156

As a client developer, I'd expect my data to be validated before any data transformation happens, so I don't have to worry about my Resource only partially being updated.

This applies more broadly to other attributes too, not just post formats.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions