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:
parent
50c240d4d0
commit
9166734ff5
|
@ -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 ) . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue