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?
Any help is greatly appreciated.
What you’re looking for are the
create_$taxonomy
,edit_$taxonomy
anddelete_$taxonomy
hooks.$taxonomy
is, of course, your taxonomy name.There’s also
create_term
,edit_term
anddelete_term
.Best place to find hooks: http://adambrown.info/p/wp_hooks/