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-query.php

    r49506 r49672  
    631631     *     @type int|string   $author                  Author ID, or comma-separated list of IDs.
    632632     *     @type string       $author_name             User 'user_nicename'.
    633      *     @type array        $author__in              An array of author IDs to query from.
    634      *     @type array        $author__not_in          An array of author IDs not to query from.
     633     *     @type int[]        $author__in              An array of author IDs to query from.
     634     *     @type int[]        $author__not_in          An array of author IDs not to query from.
    635635     *     @type bool         $cache_results           Whether to cache post information. Default true.
    636636     *     @type int|string   $cat                     Category ID or comma-separated list of IDs (this or any children).
    637      *     @type array        $category__and           An array of category IDs (AND in).
    638      *     @type array        $category__in            An array of category IDs (OR in, no children).
    639      *     @type array        $category__not_in        An array of category IDs (NOT in).
     637     *     @type int[]        $category__and           An array of category IDs (AND in).
     638     *     @type int[]        $category__in            An array of category IDs (OR in, no children).
     639     *     @type int[]        $category__not_in        An array of category IDs (NOT in).
    640640     *     @type string       $category_name           Use category slug (not name, this or any children).
    641641     *     @type array|int    $comment_count           Filter results by comment count. Provide an integer to match
     
    697697     *     @type string       $perm                    Show posts if user has the appropriate capability.
    698698     *     @type string       $ping_status             Ping status.
    699      *     @type array        $post__in                An array of post IDs to retrieve, sticky posts will be included.
    700      *     @type array        $post__not_in            An array of post IDs not to retrieve. Note: a string of comma-
     699     *     @type int[]        $post__in                An array of post IDs to retrieve, sticky posts will be included.
     700     *     @type int[]        $post__not_in            An array of post IDs not to retrieve. Note: a string of comma-
    701701     *                                                 separated IDs will NOT work.
    702702     *     @type string       $post_mime_type          The mime type of the post. Used for 'attachment' post_type.
     
    704704     *     @type int          $post_parent             Page ID to retrieve child pages for. Use 0 to only retrieve
    705705     *                                                 top-level pages.
    706      *     @type array        $post_parent__in         An array containing parent page IDs to query child pages from.
    707      *     @type array        $post_parent__not_in     An array containing parent page IDs not to query child pages from.
     706     *     @type int[]        $post_parent__in         An array containing parent page IDs to query child pages from.
     707     *     @type int[]        $post_parent__not_in     An array containing parent page IDs not to query child pages from.
    708708     *     @type string|array $post_type               A post type slug (string) or array of post type slugs.
    709709     *                                                 Default 'any' if using 'tax_query'.
     
    721721     *     @type bool         $suppress_filters        Whether to suppress filters. Default false.
    722722     *     @type string       $tag                     Tag slug. Comma-separated (either), Plus-separated (all).
    723      *     @type array        $tag__and                An array of tag IDs (AND in).
    724      *     @type array        $tag__in                 An array of tag IDs (OR in).
    725      *     @type array        $tag__not_in             An array of tag IDs (NOT in).
     723     *     @type int[]        $tag__and                An array of tag IDs (AND in).
     724     *     @type int[]        $tag__in                 An array of tag IDs (OR in).
     725     *     @type int[]        $tag__not_in             An array of tag IDs (NOT in).
    726726     *     @type int          $tag_id                  Tag id or comma-separated list of IDs.
    727727     *     @type array        $tag_slug__and           An array of tag slugs (AND in).
     
    729729     *                                                 true. Note: a string of comma-separated IDs will NOT work.
    730730     *     @type array        $tax_query               An associative array of WP_Tax_Query arguments.
    731      *                                                 See WP_Tax_Query->queries.
     731     *                                                 See WP_Tax_Query->__construct().
    732732     *     @type string       $title                   Post title.
    733733     *     @type bool         $update_post_meta_cache  Whether to update the post meta cache. Default true.
Note: See TracChangeset for help on using the changeset viewer.