XMLRPC call will not remove all terms in a taxonomy when passed an empty array
|Reported by:||jstraitiff||Owned by:||nacin|
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.
Change History (8)
2 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.9
- Version changed from 3.7.1 to 3.4