Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #53417


Ignore:
Timestamp:
06/15/2021 11:29:55 PM (3 years ago)
Author:
johnbillion
Comment:

Update: the same applies to excerpt.protected too.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #53417 – Description

    v2 v3  
    1 The schema provided by the REST API endpoints for revisions at `wp/v2/posts/{id}/revisions` and `wp/v2/pages/{id}/revisions` is incorrect. The schema states that a `content.protected` property exists for each revision, but this property does not exist.
     1The schema provided by the REST API endpoints for revisions at `wp/v2/posts/{id}/revisions` and `wp/v2/pages/{id}/revisions` is incorrect. The schema states that `content.protected` and `excerpt.protected` properties exist for each revision, but these properties do not exist.
    22
    33* [https://github.com/WordPress/wordpress-develop/blob/afee26086fea307c2a5c31c0e2018cb6acd598f7/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php#L736 The schema is constructed here] from the parent controller for posts, which does include this property
    4 * [https://github.com/WordPress/wordpress-develop/blob/afee26086fea307c2a5c31c0e2018cb6acd598f7/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php#L600-L604 When the data is prepared here] the `protected` property is not included
     4* [https://github.com/WordPress/wordpress-develop/blob/afee26086fea307c2a5c31c0e2018cb6acd598f7/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php#L600-L604 When the content data is prepared here] the `protected` property is not included
     5* [https://github.com/WordPress/wordpress-develop/blob/afee26086fea307c2a5c31c0e2018cb6acd598f7/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php#L608-L611 When the excerpt data is prepared here] the `protected` property is not included
    56
    67Two options:
    78
    8 1. Remove the `content.protected` property from the schema
    9 2. Add the `content.protected` property to the response
     91. Remove the `content.protected` and `excerpt.protected` properties from the schema
     102. Add the `content.protected` and `excerpt.protected` properties to the response
    1011
    1112Here is the `content` property from the schema. Note the `protected.context` property states that the property exists for all three contexts.