do_action( “registered_taxonomy_{$taxonomy}”, string $taxonomy, array|string $object_type, array $args )

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_category
  • registered_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

VersionDescription
6.0.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    /**
    * 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 );

You must log in before being able to contribute a note or feedback.