Make WordPress Core

Changeset 37587


Ignore:
Timestamp:
05/27/2016 05:59:12 PM (8 years ago)
Author:
DrewAPicture
Message:

Docs: Improve documentation for wp_generate_tag_cloud() default arguments by formatting them into in a hash-notation.

See #32246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/category-template.php

    r37573 r37587  
    774774 * Generates a tag cloud (heatmap) from provided data.
    775775 *
    776  * The text size is set by the 'smallest' and 'largest' arguments, which will
    777  * use the 'unit' argument value for the CSS text size unit. The 'format'
    778  * argument can be 'flat' (default), 'list', or 'array'. The flat value for the
    779  * 'format' argument will separate tags with spaces. The list value for the
    780  * 'format' argument will format the tags in a UL HTML list. The array value for
    781  * the 'format' argument will return in PHP array type format.
    782  *
    783  * The {@see 'tag_cloud_sort'} filter allows you to override the sorting.
    784  * Passed to the filter: $tags array and $args array, has to return the $tags array
    785  * after sorting it.
    786  *
    787  * The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'.
    788  * The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC' or
    789  * 'RAND'.
    790  *
    791  * The 'number' argument is how many tags to return. By default, the limit will
    792  * be to return the entire tag cloud list.
    793  *
    794  * The 'topic_count_text' argument is a nooped plural from _n_noop() to generate the
    795  * text for the tooltip of the tag link.
    796  *
    797  * The 'topic_count_text_callback' argument is a function, which given the count
    798  * of the posts with that tag returns a text for the tooltip of the tag link.
    799  *
    800776 * @todo Complete functionality.
    801777 * @since 2.3.0
    802778 *
    803779 * @param array $tags List of tags.
    804  * @param string|array $args Optional, override default arguments.
     780 * @param string|array $args {
     781 *     Optional. Array of string of arguments for generating a tag cloud.
     782 *
     783 *     @type int      $smallest                   Smallest font size used to display tags. Paired
     784 *                                                with the value of `$unit`, to determine CSS text
     785 *                                                size unit. Default 8 (pt).
     786 *     @type int      $largest                    Largest font size used to display tags. Paired
     787 *                                                with the value of `$unit`, to determine CSS text
     788 *                                                size unit. Default 22 (pt).
     789 *     @type string   $unit                       CSS text size unit to use with the `$smallest`
     790 *                                                and `$largest` values. Accepts any valid CSS text
     791 *                                                size unit. Default 'pt'.
     792 *     @type int      $number                     The number of tags to return. Accepts any
     793 *                                                positive integer or zero to return all.
     794 *                                                Default 0.
     795 *     @type string   $format                     Format to display the tag cloud in. Accepts 'flat'
     796 *                                                (tags separated with spaces), 'list' (tags displayed
     797 *                                                in an unordered list), or 'array' (returns an array).
     798 *                                                Default 'flat'.
     799 *     @type string   $separator                  HTML or text to separate the tags. Default "\n" (newline).
     800 *     @type string   $orderby                    Value to order tags by. Accepts 'name' or 'count'.
     801 *                                                Default 'name'. The {@see 'tag_cloud_sort'} filter
     802 *                                                can also affect how tags are sorted.
     803 *     @type string   $order                      How to order the tags. Accepts 'ASC' (ascending),
     804 *                                                'DESC' (descending), or 'RAND' (random). Default 'ASC'.
     805 *     @type int|bool $filter                     Whether to enable filtering of the final output
     806 *                                                via {@see 'wp_generate_tag_cloud'}. Default 1|true.
     807 *     @type string   $topic_count_text           Nooped plural text from _n_noop() to supply to
     808 *                                                tag tooltips. Default null.
     809 *     @type callable $topic_count_text_callback  Callback used to generate nooped plural text for
     810 *                                                tag tooltips based on the count. Default null.
     811 *     @type callable $topic_count_scale_callback Callback used to determine the tag count scaling
     812 *                                                value. Default default_topic_count_scale().
     813 * }
    805814 * @return string|array Tag cloud as a string or an array, depending on 'format' argument.
    806815 */
Note: See TracChangeset for help on using the changeset viewer.