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

Daniel Jalkut jalkut at red-sweater.com
Thu Jul 10 04:27:30 GMT 2008


On Jul 9, 2008, at 7:03 PM, Joe Cheng wrote:

> Daniel, do you have to create the draft in wp-admin to repro the nil
> date problem? If so, that would explain why I keep seeing complaints
> about this but can't repro it myself (since I create all my drafts
> in Writer).

In my experience, yes, it's an issue only for wp-admin created draft  
posts.  Furthermore, if the draft post is edited once after saving, in  
the wp-admin interface, I think it gets a valid date.

Check out: http://trac.wordpress.org/ticket/5698

I think XMLRPC created drafts get a reasonable date because of the  
lines in mw_newPost:

		 if ( !empty( $dateCreated ) ) {
                         $post_date =  
get_date_from_gmt(iso8601_to_datetime($dateCreated));
                         $post_date_gmt =  
iso8601_to_datetime($dateCreated, GMT);
                 } else {
                         $post_date = current_time('mysql');
                         $post_date_gmt = current_time('mysql', 1);
                 }

Which applies equally to drafts or otherwise.

Daniel



More information about the wp-xmlrpc mailing list