From 85079f08b79b7c4bc02823fce3b51c7b19021b63 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 28 Feb 2014 23:07:59 +0000 Subject: [PATCH] Enable previews for all pages of multi-page posts. Fixes #17157. Props solarissmoke, chrisscott git-svn-id: https://develop.svn.wordpress.org/trunk@27333 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 64aee53a79..4aeae5d764 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -714,6 +714,19 @@ function _wp_link_page( $i ) { $url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged'); } + if ( is_preview() ) { + $url = add_query_arg( array( + 'preview' => 'true' + ), $url ); + + if ( 'draft' !== $post->post_status ) { + $url = add_query_arg( array( + 'preview_id' => $post->ID, + 'preview_nonce' => wp_create_nonce( 'post_preview_' . $post->ID ) + ), $url ); + } + } + return ''; }