get_(taxonomy)
Filters a taxonomy term object.
The dynamic portion of the hook name, $taxonomy, refers to the slug of the term's taxonomy.
Possible hook names include:
Использование
add_filter( 'get_(taxonomy)', 'wp_kama_get_taxonomy_filter', 10, 2 );
/**
* Function for `get_(taxonomy)` filter-hook.
*
* @param WP_Term $_term Term object.
* @param string $taxonomy The taxonomy slug.
*
* @return WP_Term
*/
function wp_kama_get_taxonomy_filter( $_term, $taxonomy ){
// filter...
return $_term;
}
- $_term(WP_Term)
- Term object.
- $taxonomy(строка)
- The taxonomy slug.
Список изменений
| С версии 2.3.0 | Введена. |
| С версии 4.4.0 | $_term is now a WP_Term object. |
Где вызывается хук
wp-includes/taxonomy.php 1040
$_term = apply_filters( "get_{$taxonomy}", $_term, $taxonomy );