[wp-trac] [WordPress Trac] #18429: Create custom post types via XMLRPC

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 28 23:02:24 UTC 2012


#18429: Create custom post types via XMLRPC
----------------------------+------------------------
 Reporter:  nprasath002     |       Owner:  westi
     Type:  task (blessed)  |      Status:  reviewing
 Priority:  normal          |   Milestone:  3.4
Component:  XML-RPC         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------------

Comment (by markoheijnen):

 Basically the following code is enough and the more get_post calls isn't
 there anymore.

 {{{
                 if ( isset ( $post_data['featured_image'] ) ) {
                         // empty value deletes, non-empty value
 adds/updates
                         if ( empty( $post_data['featured_image'] ) ) {
                                 delete_post_thumbnail( $post_ID );
                         }
                         else {
                                 if ( set_post_thumbnail( $post_ID,
 $post_data['featured_image'] ) === false )
                                         return new IXR_Error( 404, __(
 "Invalid attachment ID." ) );
                         }
                         unset( $content_struct['featured_image'] );
                 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18429#comment:63>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list