get_{$taxonomy} WordPress Filter Hook
The get_{$taxonomy} hook is used to retrieve a taxonomy object by its name. This hook can be used in a number of ways, but the most common use is to retrieve a taxonomy object by its name. This is useful when you need to get information about a taxonomy, such as its labels or description, but don't necessarily need to know itsTerm ID. This hook can also be used to check if a taxonomy exists. This is useful when you need to programmatically register a taxonomy, but want to first check if it already exists.
apply_filters( "get_{$taxonomy}", WP_Term $_term , string $taxonomy ) #
Filters a taxonomy term object.
Description
The dynamic portion of the hook name, $taxonomy
, refers to the slug of the term’s taxonomy.
Possible hook names include:
get_category
get_post_tag
Parameters
- $_term
(WP_Term)Term object.
- $taxonomy
(string)The taxonomy slug.
Source
File: wp-includes/taxonomy.php
Changelog
Version | Description |
---|---|
4.4.0 | $_term is now a WP_Term object. |
2.3.0 | Introduced. |