WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 11 months ago

#29276 new enhancement

Ability to edit and preview any revision, not just autosaves — at Initial Version

Reported by: coolmann Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.9.2
Component: Revisions Keywords: needs-patch
Focuses: ui, administration Cc:

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($_GETpreview_id?)?get_post($_GETpreview_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.

Change History (1)

@coolmann
6 years ago

Updated code to preview ANY revision, not just autosaves.

Note: See TracTickets for help on using tickets.