Make WordPress Core

Changes between Initial Version and Version 7 of Ticket #29276


Ignore:
Timestamp:
02/23/2015 04:51:42 PM (10 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29276

    • Property Keywords needs-patch added
  • Ticket #29276 – Description

    initial v7  
    11It would be great if the revision management functionality could include a way to preview any revision. From a quick look at the source code, wp-includes/revision.php declares a function called
    2 
     2{{{
    33_set_preview($post)
    4 
     4}}}
    55By default it loads the most recent autosave with:
    6 
     6{{{
    77$preview = wp_get_post_autosave($post->ID);
    8 
     8}}}
    99I would like to propose that that line be changed into:
    10 
     10{{{
    1111$preview = !empty($_GET['preview_id'])?get_post($_GET['preview_id']):wp_get_post_autosave($post->ID);
    12 
    13 The nonce has already been verified in _show_post_preview(), so there should be no security implications of this change.
     12}}}
     13The nonce has already been verified in `_show_post_preview()`, so there should be no security implications of this change.
    1414
    1515With this change, the Revisions meta box (Edit Post screen) could display a "preview" icon/link that includes the appropriate nonce and does the same thing as the main "Preview" button.