Make WordPress Core

Changeset 53870

Timestamp:
08/09/2022 10:29:31 AM (2 years ago)
Author:
ocean90
Message:

Docs: Consistently document the $excluded_terms variable in get_adjacent_post().

The variable $excluded_terms is an array of excluded term IDs or empty string if none were provided.

Props grapplerulrich, costdev.
Fixes #56348.

File:
1 edited

Legend:

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

    r53827 r53870  
    18421842     * @since 4.4.0
    18431843     *
    1844      * @param array|string $excluded_terms Array of excluded term IDs. Empty string if none were provided.
     1844     * @param |string $excluded_terms Array of excluded term IDs. Empty string if none were provided.
    18451845     */
    18461846    $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
     
    19191919     * @since 4.4.0 Added the `$taxonomy` and `$post` parameters.
    19201920     *
    1921      * @param string  $join           The JOIN clause in the SQL.
    1922      * @param bool    $in_same_term   Whether post should be in a same taxonomy term.
    1923      * @param array   $excluded_terms Array of excluded term IDs.
    1924      * @param string  $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.
    1925      * @param WP_Post $post           WP_Post object.
     1921     * @param string  $join           The JOIN clause in the SQL.
     1922     * @param bool    $in_same_term   Whether post should be in a same taxonomy term.
     1923     * @param .
     1924     * @param string  $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.
     1925     * @param WP_Post $post           WP_Post object.
    19261926     */
    19271927    $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy, $post );
     
    19411941     * @since 4.4.0 Added the `$taxonomy` and `$post` parameters.
    19421942     *
    1943      * @param string  $where          The `WHERE` clause in the SQL.
    1944      * @param bool    $in_same_term   Whether post should be in a same taxonomy term.
    1945      * @param array   $excluded_terms Array of excluded term IDs.
    1946      * @param string  $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.
    1947      * @param WP_Post $post           WP_Post object.
     1943     * @param string  $where          The `WHERE` clause in the SQL.
     1944     * @param bool    $in_same_term   Whether post should be in a same taxonomy term.
     1945     * @param .
     1946     * @param string  $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.
     1947     * @param WP_Post $post           WP_Post object.
    19481948     */
    19491949    $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms, $taxonomy, $post );
Note: See TracChangeset for help on using the changeset viewer.