get_the_tags
Filters the array of tags for the given post.
Usage
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.
Changelog
Since 2.3.0 | Introduced. |
Where the hook is called
get_the_tags
wp-includes/category-template.php 1190
return apply_filters( 'get_the_tags', $terms );