get_post_tag
Filters a taxonomy term object.
This is one of the variants of the dynamic hook get_(taxonomy)
Usage
add_filter( 'get_post_tag', 'wp_kama_get_post_tag_filter', 10, 2 );
/**
* Function for `get_post_tag` filter-hook.
*
* @param WP_Term $_term Term object.
* @param string $taxonomy The taxonomy slug.
*
* @return WP_Term
*/
function wp_kama_get_post_tag_filter( $_term, $taxonomy ){
// filter...
return $_term;
}
- $_term(WP_Term)
- Term object.
- $taxonomy(string)
- The taxonomy slug.
Changelog
| Since 2.3.0 | Introduced. |
| Since 4.4.0 | $_term is now a WP_Term object. |
Where the hook is called
wp-includes/taxonomy.php 1040
$_term = apply_filters( "get_{$taxonomy}", $_term, $taxonomy );