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

Daniel Jalkut jalkut at red-sweater.com
Thu Jul 10 15:10:50 GMT 2008


Having one code path for the default date sounds like a good idea to  
me, but since the gist of that bug I referenced is to fix the behavior  
of leaving the date NULL for drafts, it might make sense to leave  
xmlrpc.php alone (with the desired behavior) until the bug is fixed  
for all of WP.

Daniel

On Jul 10, 2008, at 10:46 AM, Dougal Campbell wrote:

> Should we just eliminate the default date setting in the else  
> clause? Or at least check for 'draft' status, to match up with what  
> wp_insert_post() does? If a date isn't explicitly passed in from a  
> client, we should probably leave it empty, and let wp_insert_post()  
> do it's normal thing, so that we keep consistency independent of the  
> posting mechanism (web or API). There's already logic in  
> wp_insert_post() to handle setting default date info, so we should  
> avoid duplication here, where possible.
>
>
> -- 
> Dougal Campbell <dougal at gunters.org>
> http://dougal.gunters.org/
>
>
>
> Daniel Jalkut wrote:
>> 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
>>
>> _______________________________________________
>> wp-xmlrpc mailing list
>> wp-xmlrpc at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-xmlrpc
>>
>
> _______________________________________________
> 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