get_the_tags
Filters the array of tags for the given post.
Использование
add_filter( 'get_the_tags', 'wp_kama_get_the_tags_filter' );
/**
* Function for `get_the_tags` filter-hook.
*
* @param WP_Term[]|false|WP_Error $terms Array of WP_Term objects on success, false if there are no
* terms or the post does not exist, WP_Error on failure.
*
* @return WP_Term[]|false|WP_Error
*/
function wp_kama_get_the_tags_filter( $terms ){
// filter...
return $terms;
}
- $terms(WP_Term[]|false|WP_Error)
- Array of WP_Term objects on success, false if there are no terms or the post does not exist, WP_Error on failure.
Список изменений
| С версии 2.3.0 | Введена. |
Где вызывается хук
get_the_tags
wp-includes/category-template.php 1190
return apply_filters( 'get_the_tags', $terms );