[wp-trac] [WordPress Trac] #29276: Ability to edit and preview any revision, not just autosaves

WordPress Trac noreply at wordpress.org
Mon Feb 23 16:51:43 UTC 2015


#29276: Ability to edit and preview any revision, not just autosaves
-------------------------+---------------------------------
 Reporter:  coolmann     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Revisions    |     Version:  3.9.2
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  ui, administration
-------------------------+---------------------------------
Description changed by SergeyBiryukov:

Old description:

> It 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
>
> _set_preview($post)
>
> By default it loads the most recent autosave with:
>
> $preview = wp_get_post_autosave($post->ID);
>
> I would like to propose that that line be changed into:
>
> $preview =
> !empty($_GET['preview_id'])?get_post($_GET['preview_id']):wp_get_post_autosave($post->ID);
>
> The nonce has already been verified in _show_post_preview(), so there
> should be no security implications of this change.
>
> With 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.

New description:

 It 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
 {{{
 _set_preview($post)
 }}}
 By default it loads the most recent autosave with:
 {{{
 $preview = wp_get_post_autosave($post->ID);
 }}}
 I would like to propose that that line be changed into:
 {{{
 $preview =
 !empty($_GET['preview_id'])?get_post($_GET['preview_id']):wp_get_post_autosave($post->ID);
 }}}
 The nonce has already been verified in `_show_post_preview()`, so there
 should be no security implications of this change.

 With 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.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29276#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list