Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #40626


Ignore:
Timestamp:
05/01/2017 09:51:23 PM (8 years ago)
Author:
ocean90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40626 – Description

    initial v1  
    1 Calling functions like `get_post()` do not work within the Post Revisions API endpoint since they don't have a line like `$GLOBALS['post'] = $post;`m which the posts controller does have https://github.com/WordPress/WordPress/blob/master/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L1381-L1383
     1Calling functions like `get_post()` do not work within the Post Revisions API endpoint since they don't have a line like `$GLOBALS['post'] = $post;` which the posts controller does have https://github.com/WordPress/WordPress/blob/master/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L1381-L1383.
     2
     3Fix if I understand the issue would be to add those two lines to `prepare_item_for_response` in the revisions controller.