[wp-xmlrpc] exposing draft posts and listing all posts

Daniel Jalkut jalkut at red-sweater.com
Wed Jul 9 21:14:23 GMT 2008


Hi Joseph - just a quick note - I haven't taken time to read through  
your post yet and I'm out the door.

But I wanted to chime in to possibly clarify a problem in your  
premise. In my experience the draft post does get exposed by XMLRPC. I  
think the problem you're running into is that there's a bug in the wp- 
admin interface that causes draft posts to receive a "nil" date. This  
causes them to sort all the way to the bottom of the getRecentPosts  
array, and if you have many posts, virtually guarantees they won't  
show up in the recent posts response.

Daniel


On Jul 9, 2008, at 5:07 PM, Joseph Scott wrote:

>
> When a post is started in wp-admin and saved as a draft, it doesn't  
> appear to ever get exposed via any of the current XML-RPC methods.   
> If you happen to know the post_id for a draft you can still get at  
> it with metaWeblog.getPost, but finding out about that post in the  
> first place is the problem.  Since we now expose the post_status  
> field I don't see why metaWeblog.getRecentPosts couldn't include  
> drafts as well.  Anyone have objections/concerns to that?
>
> Along with this I've been thinking about the situation with getting  
> recent posts.  Seems like it would be handy to have a way to get all  
> of the valid post_id's, along with a little bit of info about each,  
> say the date_created_gmt and post_status fields.  Like this:
>
> [
> 	1: {
> 		date_created_gmt: 20080706T00:43:55,
> 		post_status: draft
> 		},
> 	22: {
> 		date_created_gmt: 20080706T00:43:55
> 		post_status: publish
> 		}
> ]
>
> The index would be the post_id, with then a tiny bit of info about  
> each post.  Since this could potentially be a pretty long list of  
> data (for blogs with 10,000+ posts) the amount of data besides the  
> post_id should be kept to a minimum.  My first thought was to do  
> nothing but provide an array of post_ids, but then thought that was  
> probably a bit too sparse.
>
> --
> Joseph Scott
> joseph at randomnetworks.com
> http://joseph.randomnetworks.com/
>
>
>
>
> _______________________________________________
> wp-xmlrpc mailing list
> wp-xmlrpc at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-xmlrpc



More information about the wp-xmlrpc mailing list