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.
$taxonomystringrequired
Note that it does NOT return the list of terms associated with the taxonomy. To do this, you should use get_term() to return an object or wp_list_categories() to return an HTML list of terms
function get_taxonomy( $taxonomy ) {
global $wp_taxonomies;
if ( ! taxonomy_exists( $taxonomy ) ) {
return false;
}
return $wp_taxonomies[ $taxonomy ];
}
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_taxonomy