From a98ca8b314a7e5af98c3451f365a0be7c2a372d4 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 25 Sep 2015 02:37:29 +0000 Subject: [PATCH] Links: in `get_adjacent_post()`, add a `"get_{$adjacent}_post_excluded_terms"` filter. Props rmccue, Japh, MikeHansenMe. Fixes #9571. git-svn-id: https://develop.svn.wordpress.org/trunk@34528 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index d6815ad9a3..7538a52aff 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -1629,6 +1629,18 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo $op = $previous ? '<' : '>'; $order = $previous ? 'DESC' : 'ASC'; + /** + * Filter the excluded term ids + * + * The dynamic portion of the hook name, `$adjacent`, refers to the type + * of adjacency, 'next' or 'previous'. + * + * @since 4.4.0 + * + * @param string $excluded_terms Array of excluded term IDs. + */ + $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms ); + /** * Filter the JOIN clause in the SQL for an adjacent post query. *