do_action( 'registered_taxonomy', string $taxonomy, array|string $object_type, array $args )

Fires after a taxonomy is registered.


Parameters Parameters

$taxonomy

(string) Taxonomy slug.

$object_type

(array|string) Object type or array of object types.

$args

(array) Array of taxonomy registration arguments.


Top ↑

Source Source

File: wp-includes/taxonomy.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
3.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Collins Mbaka
    /**
     * Example of registered_taxonomy usage
     * @param string $taxonomy Taxonomy key.
     * @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_example( $taxonomy, $object_type, $args ) {
    	if ( 'customtax' == $taxonomy ) {
    		// Do something after customtax is registered as custom taxonomy
    	}
    }
    add_action( 'registered_taxonomy', 'wporg_registered_taxonomy_example', 10, 3 );
    

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