[wp-trac] Re: [WordPress Trac] #6775: Post Revisions

WordPress Trac wp-trac at lists.automattic.com
Thu May 8 08:48:44 GMT 2008


#6775: Post Revisions
--------------------------------------------+-------------------------------
 Reporter:  mdawaffe                        |        Owner:  mdawaffe
     Type:  enhancement                     |       Status:  assigned
 Priority:  normal                          |    Milestone:  2.6     
Component:  General                         |      Version:  2.5.1   
 Severity:  normal                          |   Resolution:          
 Keywords:  revision needs-testing blessed  |  
--------------------------------------------+-------------------------------
Changes (by mdawaffe):

  * owner:  anonymous => mdawaffe
  * status:  new => assigned

Comment:

 6775.2.diff

  1. Moves autosave to post revisions.  For drafts, autosave overwrites the
 post (this is the same as the old behavior).  For non-drafts, a special
 post revision is inserted into the posts table.

  Only one autosave is stored per post.

  The philosophy here is that a new post revision is created every time the
 user clicks one of the save buttons, but not for each autosave.
  2. Turns on autosave for all posts.
  3. Displays warning when a user edits a post for which there is an
 autosave more recent than the post itself.
  4. Consolidates code from {{{edit_post()}}} and {{{wp_write_post()}}}.
  5. Refactors wp-admin/revision.php into {{{switch( $action ) :}}} like
 our other "object" pages.

 Still TODO:
  1. Open up revisions for pages as well. It's mostly there, but probably
 needs some tweaks.  Pages might be a bit broken right now, in fact.
  2. Review caps/permissions. Do we need any new ones like
 {{{current_user_can( 'view_revision', $id )}}}?
  3. Display revisions and/or diffs in front end?
  4. Decide how many revisions to store for each post. Right now it stores
 an arbitrary number. Should it be capped?
  5. See if get_last*modified() need any adjusting.

 New functions:
 {{{
 wp_get_autosave( $post_id );
 wp_create_autosave();
 _wp_translate_postdata(); // Rename $_POST data from form names to DB post
 columns
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6775#comment:13>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list