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
This commit is contained in:
Scott Taylor 2015-09-25 02:37:29 +00:00
parent 641150a87a
commit a98ca8b314

View File

@ -1629,6 +1629,18 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo
$op = $previous ? '<' : '>'; $op = $previous ? '<' : '>';
$order = $previous ? 'DESC' : 'ASC'; $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. * Filter the JOIN clause in the SQL for an adjacent post query.
* *