[wp-xmlrpc] post_status

Joseph Scott joseph at randomnetworks.com
Sat Dec 15 17:59:35 GMT 2007

On Dec 15, 2007, at 8:57 AM, Daniel Jalkut wrote:

> Hi Joseph - this looks great. Thanks for following up on this.  I  
> guess beggars *can* be choosers because it occurs to me that the  
> main downside here is that now the API reports more statuses than  
> can be set in the API. Before it let you set draft/publish, but  
> didn't report anything, now it reports everything but only lets you  
> set draft/publish.
> Would it make sense to support the "post_status" field in incoming  
> posts, as well?

This crossed my mind too and I think the answer is no.  I'll explain  

> What I'm mainly concerned by is that now we can get the exact  
> status of a post, but how do we represent this in a UI to the user?  
> I can only offer the user a choice between Draft and Publish. So  
> when a post's status is something else from those two states, how  
> do I know which state to indicate in the UI? Should I try to guess  
> between which of Draft and Publish the status is closest to?
> Ideally I'd be able to populate a popup menu with all the possible  
> states for a post, and the user could select from among any of them.

 From my list on the ticket (http://trac.wordpress.org/ticket/ 
4982#comment:7) here are the following potential states a post can be  
in and how they can be "set" via the current APIs:

- draft : make publish false and you'll get a draft.

- private : set a password on the post and you'll get a private post  
(wp_password field)

**** - pending : this is the one that I need to research a little bit  
more.  The general idea here is for a user with the "Contributer"  
role (http://codex.wordpress.org/Roles_and_Capabilities#Contributor)  
can "publish" a post and it will get a status of pending, meaning  
pending review.  Someone with the right to really publish posts can  
then review and publish for real.  Right now there is no way for a  
contributor user to add a post though.

- publish : the post has been published.

- future : this is a post that has been "published for a future  
date", so setting a dateCreated in the future and publish to true  
will get you here.

That leaves just the issues for pending posts.  One thing we could do  
is adjust the permissions check on contributor users so that if they  
attempt to publish their posts will always get a post_status of  
pending.  The flip side of this is that I can see that an editor  
would potentially want a list of all pending posts so that they can  
be reviewed.  We don't currently have a way to acquire that, perhaps  
some sort of wp.getPendingPosts method is in order, returning an  
array of post structs for all of the pending posts.

 From the client side of things both future and pending are likely  
new.  I'm not sure that it makes sense for a user to be able to  
select a drop down and select all of these though, unless you  
prompted them for the needed action to make that status possible.  So  
if they selected private then you'd prompt them for a password.  If  
they selected future you'd prompt them for a publish date/time.

Joseph Scott

More information about the wp-xmlrpc mailing list