[wp-xmlrpc] New method, wp.deleteCategory

Joseph Scott joseph at randomnetworks.com
Fri Nov 9 03:33:29 GMT 2007


On Nov 8, 2007, at 5:38 PM, Joe Cheng wrote:

>> This is what happens when I try to end my emails with a smart
>> alec line :-)
>
> Yeah, you were kind of asking for it ;)
>
> What happens if the promotion of an "orphaned" category results
> in two categories having the same name and the same parent?
> Might it make more sense to either 1) refuse to delete a
> category until its child categories are all gone, or 2) delete
> all the child categories automatically as well? Both of those
> behaviors would be more analogous to how deleting filesystem
> directories work (not that categories are that much like
> directories, I suppose).


More excellent questions.  I love this list!

Categories at the same level can have the same name, because what  
needs to be unique is the category slug.  And WordPress will enforce  
this automatically.  If you try to add a category with a slug that is  
in use by another category already (at any level, sibling, parent,  
child) then WP will append a dash and a number, like -2, making the  
slug unique.

This makes the deleting case easier.  The children categories of the  
one that was deleted will all be promoted and their slugs will all be  
kept the same.  There is no problem have four top level categories  
called 'WordPress' because they will each have a unique slug.

--
Joseph Scott
http://joseph.randomnetworks.com/




More information about the wp-xmlrpc mailing list