[wp-hackers] howto delete category via administrator panel
scribu
scribu at gmail.com
Sat Mar 13 06:35:17 UTC 2010
On Sat, Mar 13, 2010 at 1:32 AM, Uwiuw Bakawan.com <uwiuw at yahoo.com.sg>wrote:
>
> i'm sorry i put wrong information. in my previous email, i mention about
> post. What i meant is about delete category via dashboard >> categories
>
> so, about the term_taxonomy_id, should i
> 1. retrieve the delete category ID value from 'init'
> 2. took it child category id via get_category such as
>
> foreach ( get_category() as $category ) {
> if ( $category->parent == $delete_parent_cat_ID ) {
> //do the job here
> }
> }
>
>
> 3. delete all of its child category post then delete the child
>
> is there any better approach then this ?
>
It would be better if you could hook into
wp_delete_term()<http://xref.yoast.com/2.9.1/nav.html?_functions/wp_delete_term.html>,
but I'm not sure you have the appropriate actions.
--
http://scribu.net
More information about the wp-hackers
mailing list