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


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: