Changes between Initial Version and Version 1 of Ticket #46671, comment 7
- Timestamp:
- 04/16/2020 08:46:36 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #46671, comment 7
initial v1 1 @markparnell You should add a call to 2 {{{ 3 setup_postdata($parent) 1 @markparnell You should probably set the WP Query's post variable to the $parent 2 3 {{{#!php 4 <?php 5 global $wp_query; 6 7 $wp_query->posts = [$parent]; 8 $wp_query->post = $parent; 9 setup_postdata($parent); 4 10 }}} 5 11 6 12 to avoid breaking existing code and solve the issue with wp_reset_postdata not doing anything 13 14 15 (Though it feels hackish by lack of other way to do this)