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

WordPress Trac noreply at wordpress.org
Sun Aug 31 15:38:26 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       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  ui, administration
-------------------------+---------------------------------
Changes (by adamsilverstein):

 * keywords:   => needs-patch


Comment:

 Coolman,

 This is a great idea and something I agree we need to implement in core -
 the ability to preview any revision.

 Your patch does indeed allow the preview_id to be used to pull the proper
 revision record for previewing (and seemed so hopefully simple),
 unfortunately this isn't a complete solution for several reasons and will
 need more work before it can actually be implemented:

  * the preview nonce is id based, it can only be used to preview the
 specific post id for whcich it was created - see the nonce check in
 _show_post_preview.
 [https://core.trac.wordpress.org/browser/tags/3.9.2/src/wp-
 includes/revision.php#L523 see source]
  * post meta is currently not revisioned, so if the post display is tied
 in any way to a post meta value, the preview will be incorrect - for
 example changing the template (see #20564)
  * even after adding your change and bypassing the nonce for testing, the
 is_preview test fails in get_posts
 [https://core.trac.wordpress.org/browser/tags/3.9.2/src/wp-
 includes/query.php#L3335 see source]

 I didn't dig deeper yet to investigate why {{{is_preview}}} isn't set
 (bypassing that DID allow me to preview a revision), however the nonce and
 meta issues need to resolved before we can consider even allowing users to
 preview revisions: consider the case where a post was private for several
 revisions, then made public, or where some meta value changes what is
 visible on the page.

 Thanks for bringing up the point and creating a patch! I welcome your
 further contributions and would love to see this feature make it into the
 next WordPress release! A good start would be figuring out how to pass
 nonces for all revision ids, and how to have {{{is_preview}}} set properly
 when previewing a revision.

 Related: #11049, #20299, #20564

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


More information about the wp-trac mailing list