Template::setup_postdata( WP_Post $event )
Sets up the post data and replace the global post variable on all required places.
Contents
Parameters
- $event
-
(WP_Post) (Required) Which event will replace the Post for the templates
Return
(bool|void) Returns whatever WP_Query::setup_postdata() sends back.
Source
File: src/Tribe/Views/V2/Template.php
public function setup_postdata( WP_Post $event ) {
global $post, $wp_query;
// Replace the global $post with the event given.
$post = $event;
// Setup Post data with the info passed.
return $wp_query->setup_postdata( $post );
}
Changelog
| Version | Description |
|---|---|
| 4.9.13 | Introduced. |