[wp-trac] [WordPress Trac] #44540: Revision restoring redirect issue when using custom wp_query inside shortcodes

WordPress Trac noreply at wordpress.org
Sat Jul 7 10:47:22 UTC 2018


#44540: Revision restoring redirect issue when using custom wp_query inside
shortcodes
--------------------------+------------------------------
 Reporter:  vendetta90    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Revisions     |     Version:  4.9.7
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by vendetta90):

 Fixed that using


 {{{#!php
 add_action( 'wp_restore_post_revision', 'fix_revisions', 10, 2 );

 function fix_revisions( $post_id, $revision ) {
         global $post;
         $post->ID = $post_id;
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44540#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list