[wp-trac] [WordPress Trac] #21397: Expose post revisions on the XML-RPC Endpoint

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 30 18:15:44 UTC 2012


#21397: Expose post revisions on the XML-RPC Endpoint
--------------------------+------------------
 Reporter:  daniloercoli  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  3.5
Component:  XML-RPC       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  mobile        |
--------------------------+------------------
Changes (by maxcutler):

 * cc: maxcutler (removed)
 * cc: max@… (added)


Comment:

 I agree with most of what koke said. Here's what I would do:

 * Drop `wp.getRevision` and just use existing `wp.getPost`.
 * Drop `wp.newRevision` and just use existing `wp.newPost` or
 `wp.editPost` with `draft` or `autosave` as `post_status`.
 * `wp.getRevisions` should use `_prepare_post` with default fields of
 `ID`, `post_date`, and `post_date_gmt`. Method should take a `$fields`
 argument so that caller can customize returned fields (to avoid additional
 calls to `wp.getPost` if the caller knows it needs more than the ID and
 date).
 * `wp.restoreRevision`, fixed as stated by Marko and koke.
 * Expose `WP_POST_REVISIONS` in `wp.getOptions` as read-only `revisions`.
 * Add `autosave` to allowed list of post statuses in `_insert_post` (add
 additional case to the `switch ( $post_data['post_status'] )` statement).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21397#comment:24>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list