WordPress/wp-includes/rest-api/endpoints
Gary Pendergast 0ba364411d REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema".
There are a variety of operations a WordPress user can only perform if they have the correct capabilities. A REST API client should only display UI for one of these operations if the WordPress user can perform the operation.

Rather than requiring REST API clients to calculate whether to display UI based on potentially complicated combinations of user capabilities, `targetSchema` allows us to expose a single flag to show whether the corresponding UI should be displayed.

This change also includes flags on post objects for the following actions:

- `action-publish`: The current user can publish this post.
- `action-sticky`: The current user can make this post sticky, and the post type supports sticking.
- `action-assign-author': The current user can change the author on this post.
- `action-assign-{$taxonomy}`: The current user can assign terms from the "$taxonomy" taxonomy to this post.
- `action-create-{$taxonomy}`: The current user can create terms int the "$taxonomy" taxonomy.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44287.


Built from https://develop.svn.wordpress.org/trunk@43437


git-svn-id: http://core.svn.wordpress.org/trunk@43264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-11 06:23:27 +00:00
..
class-wp-rest-attachments-controller.php REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema". 2018-07-11 06:23:27 +00:00
class-wp-rest-comments-controller.php REST API: Filter responses based on the _fields parameter, before data is processed. 2018-05-02 01:25:21 +00:00
class-wp-rest-controller.php REST API: Filter responses based on the _fields parameter, before data is processed. 2018-05-02 01:25:21 +00:00
class-wp-rest-post-statuses-controller.php REST API: Filter responses based on the _fields parameter, before data is processed. 2018-05-02 01:25:21 +00:00
class-wp-rest-post-types-controller.php REST API: Filter responses based on the _fields parameter, before data is processed. 2018-05-02 01:25:21 +00:00
class-wp-rest-posts-controller.php REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema". 2018-07-11 06:23:27 +00:00
class-wp-rest-revisions-controller.php REST API: Filter responses based on the _fields parameter, before data is processed. 2018-05-02 01:25:21 +00:00
class-wp-rest-settings-controller.php Code is Poetry. 2017-11-30 23:11:00 +00:00
class-wp-rest-taxonomies-controller.php REST API: Filter responses based on the _fields parameter, before data is processed. 2018-05-02 01:25:21 +00:00
class-wp-rest-terms-controller.php REST API: Filter responses based on the _fields parameter, before data is processed. 2018-05-02 01:25:21 +00:00
class-wp-rest-users-controller.php REST API: When handling who=authors query parameter for GET wp/v2/users, only check edit_posts for post types that support author. 2018-05-03 06:52:21 +00:00