Make WordPress Core

Changes between Version 1 and Version 3 of Ticket #40626


Ignore:
Timestamp:
05/01/2017 10:52:56 PM (9 years ago)
Author:
jnylen0
Comment:

Thanks for the report and the patch. There are two super-minor whitespace issues in 40626-add-global.patch:

  • Blank line added to the beginning of the test file
  • Extra space in $parent_post_id = wp_is_post_revision ( $post->ID );

As far as the change itself, I can't think of any unintended effects this would have. Anyone else? Otherwise let's get this committed soon.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40626

    • Property Status changed from new to accepted
    • Property Keywords has-patch has-unit-tests needs-refresh added
    • Property Version changed from to 4.7
    • Property Milestone changed from Awaiting Review to 4.7.5
    • Property Owner set to jnylen0
  • Ticket #40626 – Description

    v1 v3  
    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;` 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/4.7.4/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L1381-L1383.
    22
    33Fix if I understand the issue would be to add those two lines to `prepare_item_for_response` in the revisions controller.