Make WordPress Core


Ignore:
Timestamp:
11/19/2020 06:22:02 PM (5 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/class-wp-term-query.php

    r49637 r49672  
    9595     *     @type string|array $taxonomy               Taxonomy name, or array of taxonomies, to which results should
    9696     *                                                be limited.
    97      *     @type int|array    $object_ids             Optional. Object ID, or array of object IDs. Results will be
     97     *     @type int|int[]    $object_ids             Optional. Object ID, or array of object IDs. Results will be
    9898     *                                                limited to terms associated with these objects.
    9999     *     @type string       $orderby                Field(s) to order terms by. Accepts:
     
    114114     *     @type bool|int     $hide_empty             Whether to hide terms not assigned to any posts. Accepts
    115115     *                                                1|true or 0|false. Default 1|true.
    116      *     @type array|string $include                Array or comma/space-separated string of term IDs to include.
     116     *     @type int[]|string $include                Array or comma/space-separated string of term IDs to include.
    117117     *                                                Default empty array.
    118      *     @type array|string $exclude                Array or comma/space-separated string of term IDs to exclude.
     118     *     @type int[]|string $exclude                Array or comma/space-separated string of term IDs to exclude.
    119119     *                                                If $include is non-empty, $exclude is ignored.
    120120     *                                                Default empty array.
    121      *     @type array|string $exclude_tree           Array or comma/space-separated string of term IDs to exclude
     121     *     @type int[]|string $exclude_tree           Array or comma/space-separated string of term IDs to exclude
    122122     *                                                along with all of their descendant terms. If $include is
    123123     *                                                non-empty, $exclude_tree is ignored. Default empty array.
     
    150150     *     @type string|array $slug                   Optional. Slug or array of slugs to return term(s) for.
    151151     *                                                Default empty.
    152      *     @type int|array    $term_taxonomy_id       Optional. Term taxonomy ID, or array of term taxonomy IDs,
     152     *     @type int|int[]    $term_taxonomy_id       Optional. Term taxonomy ID, or array of term taxonomy IDs,
    153153     *                                                to match when querying terms.
    154154     *     @type bool         $hierarchical           Whether to include terms that have non-empty descendants
Note: See TracChangeset for help on using the changeset viewer.