WordPress.org

Make WordPress Core

Ticket #17157: 17157.diff

File 17157.diff, 758 bytes (added by solarissmoke, 7 years ago)
  • wp-includes/post-template.php

     
    684684 * @return string Link.
    685685 */
    686686function _wp_link_page( $i ) {
    687         global $post, $wp_rewrite;
     687        global $post, $wp_rewrite, $preview;
    688688
    689689        if ( 1 == $i ) {
    690690                $url = get_permalink();
     
    696696                else
    697697                        $url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged');
    698698        }
     699       
     700        if( $preview )
     701                $url = add_query_arg( array( 'preview' => 'true', 'preview_id' => $post->ID, 'preview_nonce' => wp_create_nonce( 'post_preview_' . $post->ID ) ), $url );
    699702
    700703        return '<a href="' . esc_url( $url ) . '">';
    701704}