[wp-trac] [WordPress Trac] #40627: Revisions API do not initialize GLOBALS['post']

WordPress Trac noreply at wordpress.org
Mon May 1 21:46:40 UTC 2017

#40627: Revisions API do not initialize GLOBALS['post']
 Reporter:  pdufour       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
 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

 Fix if I understand the issue would be to add those two lines to
 `prepare_item_for_response` in the revisions controller.

Ticket URL: <https://core.trac.wordpress.org/ticket/40627>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list