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/link-template.php

    r49622 r49672  
    16671667 *
    16681668 * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
    1669  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     1669 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    16701670 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    16711671 * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
     
    16821682 *
    16831683 * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
    1684  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     1684 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    16851685 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    16861686 * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
     
    17011701 *
    17021702 * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
    1703  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     1703 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    17041704 * @param bool         $previous       Optional. Whether to retrieve previous post. Default true
    17051705 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    18951895 * @param string       $title          Optional. Link title format. Default '%title'.
    18961896 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    1897  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     1897 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    18981898 * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
    18991899 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    19541954 * @param string       $title          Optional. Link title format. Default '%title'.
    19551955 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    1956  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     1956 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    19571957 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    19581958 */
     
    19891989 * @param string       $title          Optional. Link title format. Default '%title'.
    19901990 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    1991  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     1991 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    19921992 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    19931993 */
     
    20052005 * @param string       $title          Optional. Link title format. Default '%title'.
    20062006 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    2007  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default true.
     2007 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default true.
    20082008 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    20092009 */
     
    20222022 * @param bool         $in_same_term   Optional. Whether returned post should be in a same taxonomy term.
    20232023 *                                     Default false.
    2024  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
     2024 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
    20252025 *                                     Default empty.
    20262026 * @param bool         $start          Optional. Whether to retrieve first or last post. Default true
     
    20862086 * @param string       $link           Optional. Link permalink format. Default '%title'.
    20872087 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    2088  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     2088 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    20892089 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    20902090 * @return string The link URL of the previous post in relation to the current post.
     
    21042104 * @param string       $link           Optional. Link permalink format. Default '%title'.
    21052105 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    2106  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     2106 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    21072107 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    21082108 */
     
    21192119 * @param string       $link           Optional. Link permalink format. Default '%title'.
    21202120 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    2121  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     2121 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    21222122 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    21232123 * @return string The link URL of the next post in relation to the current post.
     
    21372137 * @param string       $link           Optional. Link permalink format. Default '%title'
    21382138 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    2139  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
     2139 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
    21402140 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    21412141 */
     
    21542154 * @param string       $link           Link permalink format.
    21552155 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    2156  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. Default empty.
     2156 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. Default empty.
    21572157 * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
    21582158 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    22192219 * @param string       $link           Link permalink format.
    22202220 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
    2221  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. Default empty.
     2221 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. Default empty.
    22222222 * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
    22232223 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
     
    25682568 *     @type string       $next_text          Anchor text to display in the next post link. Default '%title'.
    25692569 *     @type bool         $in_same_term       Whether link should be in a same taxonomy term. Default false.
    2570  *     @type array|string $excluded_terms     Array or comma-separated list of excluded term IDs. Default empty.
     2570 *     @type int[]|string $excluded_terms     Array or comma-separated list of excluded term IDs. Default empty.
    25712571 *     @type string       $taxonomy           Taxonomy, if `$in_same_term` is true. Default 'category'.
    25722572 *     @type string       $screen_reader_text Screen reader text for the nav element. Default 'Post navigation'.
Note: See TracChangeset for help on using the changeset viewer.