Can taxonomies of custom post types be used with category actions?

I need to create a hook after the creation, edit and deletion of a taxonomy organizing a custom post type I have. I’ve noticed though that I can’t use the following actions with those taxonomies:

add_action( 'create_category', 'some_function' );
add_action( 'delete_category', 'some_function' );
add_action( 'edit_category', 'some_function' );

It would be ideal if I could use these because I only really need the ID of the category to do the process I had in mind. Is there some argument I can pass in with register_taxonomy() that will allow those actions to be associated with taxonomies of custom post types? Or is there some way to simulate these hooks in another way?

Read More

Any help is greatly appreciated.

Related posts

Leave a Reply

1 comment

  1. What you’re looking for are the create_$taxonomy, edit_$taxonomy and delete_$taxonomy hooks. $taxonomy is, of course, your taxonomy name.

    <?php
    add_action( 'create_your_tax', 'wpse32510_create', 10, 2 );
    funciton wpse32510_create( $term_id, $tt_id )
    {
       // do stuff
    }
    

    There’s also create_term, edit_term and delete_term.

    Best place to find hooks: http://adambrown.info/p/wp_hooks/