Wordpress/tests
Timothy Jacobs 88ec90d6df REST API: Support a route-level validation callback.
Most request data is validated on a per-parameter basis. Often, however, additional validation is needed that operates on the entire request object. Currently, this is done in the route callback and often in the `prepare_item_for_database` method specifically.

#50244 aims to introduce batch processing in the REST API. An important feature is the ability to enforce that all requests have valid data before executing the route callbacks in "pre-validate" mode.

This patch introduces support for calling a `validate_callback` after all parameter validation has succeeded. That allows moving more validation outside of the route callback and into `WP_REST_Request` which will improve "pre-validate" support.

Props TimothyBlynJacobs, zieladam.
Fixes #51255.
See #50244.




git-svn-id: https://develop.svn.wordpress.org/trunk@48945 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-05 18:07:46 +00:00
..
e2e Editor: update JavaScript packages 2020-06-26 13:31:11 +00:00
gutenberg Block Editor: Add a script to run Gutenberg end 2 end tests on Core. 2020-07-07 16:06:43 +00:00
phpunit REST API: Support a route-level validation callback. 2020-09-05 18:07:46 +00:00
qunit Tests: Update wp-api-generated.js to reflect the new "Reusable Blocks" post type label. 2020-08-23 14:38:40 +00:00