How to use create_term, edit_term, delete_term actions?

There’s not much to it, you don’t need to return anything. Note that you also can’t output anything to the browser, that will cause it to fail.

function my_create( $term_id, $tt_id, $taxonomy ){
    // do some stuff
}
add_action( 'create_term', 'my_create', 10, 3 );

You mention using this with a custom taxonomy, note that there are also actions that let you hook specific taxonomies:

do_action("create_$taxonomy", $term_id, $tt_id);

Leave a Comment