WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/23/2015 07:56:32 PM (4 years ago)
Author:
boonebgorges
Message:

Move excluded_terms filter in get_adjacent_post().

The filter was added in 4.4 [34528] #9571, but in a place where it could not
affect the adjacent post query.

Fixes #35211.

File:
1 edited

Legend:

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

    r36011 r36078  
    15691569    $join = '';
    15701570    $where = '';
     1571    $adjacent = $previous ? 'previous' : 'next';
    15711572
    15721573    if ( $in_same_term || ! empty( $excluded_terms ) ) {
     
    16001601            $where .= " AND tt.term_id IN (" . implode( ',', $term_array ) . ")";
    16011602        }
     1603
     1604        /**
     1605         * Filter the IDs of terms excluded from adjacent post queries.
     1606         *
     1607         * The dynamic portion of the hook name, `$adjacent`, refers to the type
     1608         * of adjacency, 'next' or 'previous'.
     1609         *
     1610         * @since 4.4.0
     1611         *
     1612         * @param string $excluded_terms Array of excluded term IDs.
     1613         */
     1614        $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
    16021615
    16031616        if ( ! empty( $excluded_terms ) ) {
     
    16361649    }
    16371650
    1638     $adjacent = $previous ? 'previous' : 'next';
    16391651    $op = $previous ? '<' : '>';
    16401652    $order = $previous ? 'DESC' : 'ASC';
    1641 
    1642     /**
    1643      * Filter the excluded term ids
    1644      *
    1645      * The dynamic portion of the hook name, `$adjacent`, refers to the type
    1646      * of adjacency, 'next' or 'previous'.
    1647      *
    1648      * @since 4.4.0
    1649      *
    1650      * @param string $excluded_terms Array of excluded term IDs.
    1651      */
    1652     $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
    16531653
    16541654    /**
Note: See TracChangeset for help on using the changeset viewer.