Make WordPress Core


Ignore:
Timestamp:
11/19/2020 06:22:02 PM (4 years ago)
Author:
johnbillion
Message:

Docs: Document parameters that accept an array of integers using typed array notation.

While many of these parameters also technically accept an array of numerical strings, they are all ultimately cast to an array of integers. Documenting them as such assists developers in understanding the expected types.

See #51800, #41756

File:
1 edited

Legend:

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

    r49669 r49672  
    487487 *     for information on additional accepted arguments.
    488488 *
    489  *     @type int|array    $current_category      ID of category, or array of IDs of categories, that should get the
     489 *     @type int|int[]    $current_category      ID of category, or array of IDs of categories, that should get the
    490490 *                                               'current-cat' class. Default 0.
    491491 *     @type int          $depth                 Category depth. Used for tab indentation. Default 0.
    492492 *     @type bool|int     $echo                  Whether to echo or return the generated markup. Accepts 0, 1, or their
    493493 *                                               bool equivalents. Default 1.
    494  *     @type array|string $exclude               Array or comma/space-separated string of term IDs to exclude.
     494 *     @type int[]|string $exclude               Array or comma/space-separated string of term IDs to exclude.
    495495 *                                               If `$hierarchical` is true, descendants of `$exclude` terms will also
    496496 *                                               be excluded; see `$exclude_tree`. See get_terms().
    497497 *                                               Default empty string.
    498  *     @type array|string $exclude_tree          Array or comma/space-separated string of term IDs to exclude, along
     498 *     @type int[]|string $exclude_tree          Array or comma/space-separated string of term IDs to exclude, along
    499499 *                                               with their descendants. See get_terms(). Default empty string.
    500500 *     @type string       $feed                  Text to use for the feed link. Default 'Feed for all posts filed
Note: See TracChangeset for help on using the changeset viewer.