Make WordPress Core


Ignore:
Timestamp:
03/11/2018 05:31:04 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Link Template: Apply get_{$adjacent}_post_excluded_terms filter to an empty excluded_terms parameter as well.

Props soulseekah, zottto.
Fixes #43521.

File:
1 edited

Legend:

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

    r42736 r42828  
    16831683    $adjacent = $previous ? 'previous' : 'next';
    16841684
     1685    /**
     1686     * Filters the IDs of terms excluded from adjacent post queries.
     1687     *
     1688     * The dynamic portion of the hook name, `$adjacent`, refers to the type
     1689     * of adjacency, 'next' or 'previous'.
     1690     *
     1691     * @since 4.4.0
     1692     *
     1693     * @param string $excluded_terms Array of excluded term IDs.
     1694     */
     1695    $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
     1696
    16851697    if ( $in_same_term || ! empty( $excluded_terms ) ) {
    16861698        if ( ! empty( $excluded_terms ) && ! is_array( $excluded_terms ) ) {
     
    17151727            $where .= ' AND tt.term_id IN (' . implode( ',', $term_array ) . ')';
    17161728        }
    1717 
    1718         /**
    1719          * Filters the IDs of terms excluded from adjacent post queries.
    1720          *
    1721          * The dynamic portion of the hook name, `$adjacent`, refers to the type
    1722          * of adjacency, 'next' or 'previous'.
    1723          *
    1724          * @since 4.4.0
    1725          *
    1726          * @param string $excluded_terms Array of excluded term IDs.
    1727          */
    1728         $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
    17291729
    17301730        if ( ! empty( $excluded_terms ) ) {
Note: See TracChangeset for help on using the changeset viewer.