Get Taxonomy name from “registered_taxonomy” hook

I am using add_action to run a function after a taxonomy is created. Everything works but I can’t figure out how to grab the taxonomy name. I figured $args->name would be the way to go but it is not working, it is not returning anything.

function test( $taxonomy, $object_type, $args ) {
$catname = $args->name;

add_action( ‘registered_taxonomy’, ‘test’,10, 3 );

Read more here: Get Taxonomy name from “registered_taxonomy” hook

Leave a Reply

Your email address will not be published. Required fields are marked *