From 80974b0db626cefc249bc64bc433b1590324c857 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 25 Sep 2015 02:38:25 +0000 Subject: [PATCH] Links: in `get_adjacent_post()`, add a `"get_{$adjacent}_post_excluded_terms"` filter. Props rmccue, Japh, MikeHansenMe. Fixes #9571. Built from https://develop.svn.wordpress.org/trunk@34528 git-svn-id: http://core.svn.wordpress.org/trunk@34492 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 12 ++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index d6815ad9a3..7538a52aff 100644 --- a/wp-includes/link-template.php +++ b/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. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 8cdb9c9bb6..28b16e9179 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34527'; +$wp_version = '4.4-alpha-34528'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.