Opened 6 years ago

Closed 5 years ago

#4982 closed defect (bug) (fixed)

XMLRPC should expose draft status of entries

Reported by: redsweater Owned by: westi
Priority: normal Milestone: 2.5
Component: XML-RPC Version: 2.3
Severity: normal Keywords: has-patch
Cc: redsweater, josephscott

Description

Although getRecentPosts returns items whose publish status is "draft," there is no indication in the XML attributes of the status of the item. This leaves remote clients in a tricky position when it comes to relating the status of the post to the user.

I propose a new boolean attribute "wp_draft" be added to these posts, to definitely convey whether the post is a draft or not.

Attachments (1)

xmlrpc.php.diff (864 bytes) - added by josephscott 6 years ago.

Download all attachments as: .zip

Change History (12)

  • Milestone set to 2.4
  • Version set to 2.3
  • Cc josephscott added

Would it be helpful to know the other possible states? Ryan mentioned 5: http://boren.nu/archives/2007/09/05/post-status-transitions/

  • publish
  • draft
  • private
  • future
  • pending

See also:

http://trac.wordpress.org/browser/trunk/wp-admin/includes/schema.php?rev=6075#L103

Not all of those are applicable to posts though.

comment:5   ryan6 years ago

Most of those are legacy. Only inherit is still used among those in the schema but not in my list, and it really isn't a public status.

If they're legacy, can't we take them out?

In -trunk I see the following potential post status values for a post:

  • draft
  • private
  • pending
  • publish
  • future

For pages there are the following potential values:

  • draft
  • private
  • publish

There were all the possible states I was able to put posts and pages in using the regular web admin. Does this seem like a reasonable list?

The diff adds the 'post_status' field to data returned from metaWeblog.getPost and metaWeblog.getRecentPosts. Just as a note, wp.getPage already provides this for pages in the 'page_status' field.

  • Keywords has-patch added
  • Owner changed from anonymous to westi
  • Status changed from new to assigned
  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6358]) Expose post_status over xmlrpc. Fixes #4982 props josephscott

Note: See TracTickets for help on using tickets.