Conversation
Just as `WP_REST_Controller` is mostly just a fancy wrapper for `register_rest_route()`, `WPCOM_REST_API_V2_Field_Controller` is a wrapper for `register_rest_field()`. It handles a few conveniences: * Returning the correct things (errors, default values, etc.) for permission check errors. * Ensuring output is always correctly typecast. * `?context=...` filtering for nested structures, which core does not handle correctly.
This is automated check which relies on Generated by 🚫 dangerJS |
tyxla
left a comment
There was a problem hiding this comment.
This is looking and working great for me 👍 💯
I've left some minor suggestions, nothing blocking though, so feel free to take or leave any of them.
Feel free to 🚢 at will!
tyxla
left a comment
There was a problem hiding this comment.
This is looking great, tests are passing too 👍
🚢
|
🚢 |
lezama
left a comment
There was a problem hiding this comment.
After Linter fixes fixes let me approve this again
…alue Return `WP_Error` from `update_from_request()` when `update_permission_check()` returns false.
|
WordPress.com code ready at D20160-code. |
Just as
WP_REST_Controlleris mostly just a fancy wrapper forregister_rest_route(),WPCOM_REST_API_V2_Field_Controlleris a wrapperfor
register_rest_field().Changes proposed in this Pull Request:
The new class handles a few conveniences:
permission check errors.
?context=...filtering for nested structures, which core does nothandle correctly.
Testing instructions:
yarn docker:phpunit --group rest-apiProposed changelog entry for your changes:
None required.