Enable previews for all pages of multi-page posts. Fixes #17157. Props solarissmoke, chrisscott

Built from https://develop.svn.wordpress.org/trunk@27333


git-svn-id: http://core.svn.wordpress.org/trunk@27185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-02-28 23:08:13 +00:00
parent 50c240d4d0
commit 9166734ff5
1 changed files with 13 additions and 0 deletions

View File

@ -714,6 +714,19 @@ function _wp_link_page( $i ) {
$url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged'); $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 '<a href="' . esc_url( $url ) . '">'; return '<a href="' . esc_url( $url ) . '">';
} }