[wp-trac] [WordPress Trac] #16003: XMLRPC should use category ids instead of names

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 11 15:47:31 UTC 2011


#16003: XMLRPC should use category ids instead of names
-------------------------------------+------------------------------
 Reporter:  koke                     |       Owner:  ericmann
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  XML-RPC                  |     Version:  3.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------
Changes (by ericmann):

 * keywords:   => has-patch needs-testing
 * owner:   => ericmann
 * status:  new => assigned


Comment:

 A quick look at the code shows we're already fetching an array of category
 IDs while performing `metaWeblog.getPost` and `metaWeblog.getRecentPosts`,
 so I've added a return parameter called `wp_category_ids` that just adds
 this array to the XML-RPC response for those two requests.

 For `metaWeblog.newPost`, you can send an array of category IDs in the
 parameter `wp_category_ids`.  The code will first create an empty array,
 then fill it with the IDs of any named categories sent the old way (this
 was existing code) and add in any IDs sent in the new parameter.  So, you
 could actually send some categories as named values and some as just their
 IDs, and WordPress will map the entire group to a single array of IDs.

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


More information about the wp-trac mailing list