[wp-trac] [WordPress Trac] #18438: Create a new term in XMLRPC

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 12 05:03:24 UTC 2012


#18438: Create a new term in XMLRPC
----------------------------+-----------------------
 Reporter:  nprasath002     |       Owner:  westi
     Type:  task (blessed)  |      Status:  accepted
 Priority:  normal          |   Milestone:  3.4
Component:  XML-RPC         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+-----------------------

Comment (by nprasath002):

 Replying to [comment:7 markoheijnen]:
 > Was busy with creating unit tests for the patch and I wonder the
 following things:
 >
 > wp_newTerm
 >  - Check if taxonomy is set and is a string
 A new term must be associated with a taxonomy. So we check whether the
 input taxonomy is valid.
 >  - Why is there the following line: $taxonomy = (array) taxonomy?
 get_taxonomy() returns a taxonomy object.
 We use $object->key to get the value from the object.
 To use $object['key'] you must cast the object to an array.
 Of course we can use $object-key through out.
 But all of the other functions are coded in $object['key'] style.
 For consistency i casted it to an array.
 >  - return term_id should have strval()
 +1
 >
 > wp_editTerm
 >  - should the current_user_can check $term_id as second parameter?
 I think for terms we check capability in general. Not for a specific term
 like in posts.
 AFAIK there is no 'edit_term' cap defined in the core.
 >  - error check op $parent_term but trying to show the error of $term
 +1. Should fix that
 >  - Error message for parent variable is not the same as newTerm, the
 same for error code
 +1

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


More information about the wp-trac mailing list