get_tags
Filters the array of term objects returned for the 'post_tag' taxonomy.
Usage
add_filter( 'get_tags', 'wp_kama_get_tags_filter', 10, 2 ); /** * Function for `get_tags` filter-hook. * * @param WP_Term[]|int|WP_Error $tags Array of 'post_tag' term objects, a count thereof, or WP_Error if any of the taxonomies do not exist. * @param array $args An array of arguments. See {@see get_terms()}. * * @return WP_Term[]|int|WP_Error */ function wp_kama_get_tags_filter( $tags, $args ){ // filter... return $tags; }
- $tags(WP_Term[]|int|WP_Error)
- Array of 'post_tag' term objects, a count thereof, or WP_Error if any of the taxonomies do not exist.
- $args(array)
- An array of arguments. See {@see get_terms()}.
Changelog
Since 2.3.0 | Introduced. |
Where the hook is called
get_tags
wp-includes/category.php 312
$tags = apply_filters( 'get_tags', $tags, $args );