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

Top ↑

Parameters

$_term

(WP_Term)Term object.

$taxonomy

(string)The taxonomy slug.


Top ↑

Source

File: wp-includes/taxonomy.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0$_term is now a WP_Term object.
2.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More