WordPress.org

Make WordPress Core

Changeset 27333


Ignore:
Timestamp:
02/28/2014 11:07:59 PM (7 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r27262 r27333  
    715715    }
    716716
     717    if ( is_preview() ) {
     718        $url = add_query_arg( array(
     719            'preview' => 'true'
     720        ), $url );
     721
     722        if ( 'draft' !== $post->post_status ) {
     723            $url = add_query_arg( array(
     724                'preview_id'    => $post->ID,
     725                'preview_nonce' => wp_create_nonce( 'post_preview_' . $post->ID )
     726            ), $url );
     727        }
     728    }
     729
    717730    return '<a href="' . esc_url( $url ) . '">';
    718731}
Note: See TracChangeset for help on using the changeset viewer.