Changes between Version 1 and Version 2 of Ticket #46671, comment 4
- Timestamp:
- 07/11/2019 09:02:06 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #46671, comment 4
v1 v2 1 1 I just spent hours trying to figure out why restoring revisions sometimes redirects to the wrong post and after debugging and pulling my hair out arrived at a conclusion that this has to be a bug in WP core. 2 2 3 Then I found this ticket (along with https://core.trac.wordpress.org/ticket/18408 which is still unresolved after 8 years and may or may not be related).3 Then I found this ticket (along with #18408 which is still unresolved after 8 years and may or may not be related). 4 4 5 5 In our case, we have a hook into `transition_post_status`, and in this hook, we perform a secondary query using the correct `new WP_Query()`, `have_posts()`, and `the_post()`, followed by `wp_reset_postdata()`.