id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 44540 Revision restoring redirect issue when using custom wp_query inside shortcodes vendetta90 "Using a custom WP_Query inside page content shortcodes leads to weird ""revisions restoring"" behavior which is redirecting to improper page id. However the page content is restored correctly. Have found this lines 55, 56 in revision.php {{{ wp_restore_post_revision( $revision->ID ); $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) ) }}} While wp_restore_post_revision( $revision->ID ) returns a correct post_id, the redirect is made to get_edit_post_link( $post->ID, 'url' ) and $post->ID may be broken by custom wp_query loop. Why not using wp_restore_post_revision( $revision->ID ) returned result to perform a correct redirect? " defect (bug) assigned normal Awaiting Review Revisions 4.9.7 normal