mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-26 06:13:07 +02:00
REST API: Set global $post when preparing revisions.
For compatibility with filters on hooks on content filters (such as shortcodes), we need to set the global. This mirrors the Posts controller. Props pdufour, jnylen0. Fixes #40626. Built from https://develop.svn.wordpress.org/trunk@40601 git-svn-id: http://core.svn.wordpress.org/trunk@40471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
027e8d9218
commit
ba94bd62a0
@ -338,6 +338,9 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* @return WP_REST_Response Response object.
|
||||
*/
|
||||
public function prepare_item_for_response( $post, $request ) {
|
||||
$GLOBALS['post'] = $post;
|
||||
|
||||
setup_postdata( $post );
|
||||
|
||||
$schema = $this->get_item_schema();
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.8-alpha-40600';
|
||||
$wp_version = '4.8-alpha-40601';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user