WordPress at a glance

get_taxonomy() WP 1.0

Retrieves the taxonomy object of $taxonomy.

The get_taxonomy function will first check that the parameter string given is a taxonomy object and if it is, it will return it.

  • Global. Array. $wp_taxonomies The registered taxonomies.
Is the basis for: is_taxonomy_hierarchical()
✈ 1 time = 0.000009s = speed of light | 50000 times = 0.01s = speed of light PHP 7.0.14, WP 4.7

No Hooks.


WP_Taxonomy/false. The Taxonomy Object or false if $taxonomy doesn't exist.


get_taxonomy( $taxonomy );
$taxonomy(string) (required)
Name of taxonomy object to return.

Code of get_taxonomy: wp-includes/taxonomy.php VER 4.9.8

function get_taxonomy( $taxonomy ) {
	global $wp_taxonomies;

	if ( ! taxonomy_exists( $taxonomy ) )
		return false;

	return $wp_taxonomies[$taxonomy];

Related Functions

From category: Any taxonomy

No comments
    Hello, !     Log In . Register