tag_cloud_sort
Filters how the items in a tag cloud are sorted.
Usage
add_filter( 'tag_cloud_sort', 'wp_kama_tag_cloud_sort_filter', 10, 2 ); /** * Function for `tag_cloud_sort` filter-hook. * * @param WP_Term[] $tags Ordered array of terms. * @param array $args An array of tag cloud arguments. * * @return WP_Term[] */ function wp_kama_tag_cloud_sort_filter( $tags, $args ){ // filter... return $tags; }
- $tags(WP_Term[])
- Ordered array of terms.
- $args(array)
- An array of tag cloud arguments.
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
wp-includes/category-template.php 900
$tags_sorted = apply_filters( 'tag_cloud_sort', $tags, $args );