Fires after a specific taxonomy is registered.
Description
The dynamic portion of the filter name, $taxonomy, refers to the taxonomy key.
Possible hook names include:
registered_taxonomy_categoryregistered_taxonomy_post_tag
Parameters
$taxonomystring- Taxonomy slug.
$object_typearray|string- Object type or array of object types.
$argsarray- Array of taxonomy registration arguments.
Source
do_action( "registered_taxonomy_{$taxonomy}", $taxonomy, $object_type, (array) $taxonomy_object );
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |
/**
* Example of registered_taxonomy_{taxonomy} usage. In this case: customtax taxonomy
* @param string $taxonomy Taxonomy key. In this case: customtax
* @param array|string $object_type Name of the object type for the taxonomy object.
* @param array|string $args Optional args used in taxonomy registration.
*/
function wporg_registered_taxonomy_customtax( $taxonomy, $object_type, $args ) {
// Do something after customtax is registered as custom taxonomy
}
add_action( ‘registered_taxonomy_customtax’, ‘wporg_registered_taxonomy_customtax’, 10, 3 );