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/class-wp-date-query.php

    r49108 r49672  
    116116     *             @type bool         $inclusive     Optional. Include results from dates specified in 'before' or
    117117     *                                               'after'. Default false.
    118      *             @type int|array    $year          Optional. The four-digit year number. Accepts any four-digit year
     118     *             @type int|int[]    $year          Optional. The four-digit year number. Accepts any four-digit year
    119119     *                                               or an array of years if `$compare` supports it. Default empty.
    120      *             @type int|array    $month         Optional. The two-digit month number. Accepts numbers 1-12 or an
     120     *             @type int|int[]    $month         Optional. The two-digit month number. Accepts numbers 1-12 or an
    121121     *                                               array of valid numbers if `$compare` supports it. Default empty.
    122      *             @type int|array    $week          Optional. The week number of the year. Accepts numbers 0-53 or an
     122     *             @type int|int[]    $week          Optional. The week number of the year. Accepts numbers 0-53 or an
    123123     *                                               array of valid numbers if `$compare` supports it. Default empty.
    124      *             @type int|array    $dayofyear     Optional. The day number of the year. Accepts numbers 1-366 or an
     124     *             @type int|int[]    $dayofyear     Optional. The day number of the year. Accepts numbers 1-366 or an
    125125     *                                               array of valid numbers if `$compare` supports it.
    126      *             @type int|array    $day           Optional. The day of the month. Accepts numbers 1-31 or an array
     126     *             @type int|int[]    $day           Optional. The day of the month. Accepts numbers 1-31 or an array
    127127     *                                               of valid numbers if `$compare` supports it. Default empty.
    128      *             @type int|array    $dayofweek     Optional. The day number of the week. Accepts numbers 1-7 (1 is
     128     *             @type int|int[]    $dayofweek     Optional. The day number of the week. Accepts numbers 1-7 (1 is
    129129     *                                               Sunday) or an array of valid numbers if `$compare` supports it.
    130130     *                                               Default empty.
    131      *             @type int|array    $dayofweek_iso Optional. The day number of the week (ISO). Accepts numbers 1-7
     131     *             @type int|int[]    $dayofweek_iso Optional. The day number of the week (ISO). Accepts numbers 1-7
    132132     *                                               (1 is Monday) or an array of valid numbers if `$compare` supports it.
    133133     *                                               Default empty.
    134      *             @type int|array    $hour          Optional. The hour of the day. Accepts numbers 0-23 or an array
     134     *             @type int|int[]    $hour          Optional. The hour of the day. Accepts numbers 0-23 or an array
    135135     *                                               of valid numbers if `$compare` supports it. Default empty.
    136      *             @type int|array    $minute        Optional. The minute of the hour. Accepts numbers 0-60 or an array
     136     *             @type int|int[]    $minute        Optional. The minute of the hour. Accepts numbers 0-60 or an array
    137137     *                                               of valid numbers if `$compare` supports it. Default empty.
    138      *             @type int|array    $second        Optional. The second of the minute. Accepts numbers 0-60 or an
     138     *             @type int|int[]    $second        Optional. The second of the minute. Accepts numbers 0-60 or an
    139139     *                                               array of valid numbers if `$compare` supports it. Default empty.
    140140     *         }
Note: See TracChangeset for help on using the changeset viewer.