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

WordPress Trac noreply at wordpress.org
Wed Aug 20 14:30:40 UTC 2014


#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              |   Keywords:
  Focuses:  ui, administration  |
--------------------------------+-----------------------------
 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>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list