[wp-trac] [WordPress Trac] #26686: XMLRPC call will not remove all terms in a taxonomy when passed an empty array

WordPress Trac noreply at wordpress.org
Thu Dec 19 18:56:06 UTC 2013


#26686: XMLRPC call will not remove all terms in a taxonomy when passed an empty
array
--------------------------+-----------------------------
 Reporter:  jstraitiff    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  XML-RPC       |    Version:  3.7.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 When calling wp.editPost from XMLRPC, if you pass an empty array for a set
 of terms it will not remove all the terms in that taxonomy for a post.  If
 the array has even one term id in it, it will set it properly, but empty
 arrays get ignored and thus don't change the current terms.

 I found and fixed the issue and have attached a patch.  I'm adding one
 line in _insert_post (in wp-includes/class-wp-xmlrpc-server.php) to
 initialize the $terms array for a particular taxonomy, thus when the
 following foreach is called (and skips because of the empty array) then an
 empty array will be passed along and cause the terms deletion to happen.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26686>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list