apply_filters( ‘wp_tag_cloud’, string|string[] $return, array $args )

Filters the tag cloud output.


Tag cloud as a string or an array, depending on 'format' argument.
An array of tag cloud arguments. See wp_tag_cloud() for information on accepted arguments.
More Arguments from wp_tag_cloud( … $args )Array or string of arguments for generating a tag cloud.
  • smallest int
    Smallest font size used to display tags. Paired with the value of $unit, to determine CSS text size unit. Default 8 (pt).
  • largest int
    Largest font size used to display tags. Paired with the value of $unit, to determine CSS text size unit. Default 22 (pt).
  • unit string
    CSS text size unit to use with the $smallest and $largest values. Accepts any valid CSS text size unit. Default 'pt'.
  • number int
    The number of tags to return. Accepts any positive integer or zero to return all.
    Default 0.
  • format string
    Format to display the tag cloud in. Accepts 'flat' (tags separated with spaces), 'list' (tags displayed in an unordered list), or 'array' (returns an array).
    Default 'flat'.
  • separator string
    HTML or text to separate the tags. Default "n" (newline).
  • orderby string
    Value to order tags by. Accepts 'name' or 'count'.
    Default 'name'. The 'tag_cloud_sort' filter can also affect how tags are sorted.
  • order string
    How to order the tags. Accepts 'ASC' (ascending), 'DESC' (descending), or 'RAND' (random). Default 'ASC'.
  • filter int|bool
    Whether to enable filtering of the final output via 'wp_generate_tag_cloud'. Default 1.
  • topic_count_text array
    Nooped plural text from _n_noop() to supply to tag counts. Default null.
  • topic_count_text_callback callable
    Callback used to generate nooped plural text for tag counts based on the count. Default null.
  • topic_count_scale_callback callable
    Callback used to determine the tag count scaling value. Default default_topic_count_scale() .
  • show_count bool|int
    Whether to display the tag counts. Default 0. Accepts 0, 1, or their bool equivalents.


$return = apply_filters( 'wp_tag_cloud', $return, $args );



User Contributed Notes

  1. Skip to note 4 content

    This “filter” only returns the HTML after generated. There is no longer a filter for the args before generating.

You must log in before being able to contribute a note or feedback.