In get_adjacent_post(), $excluded_terms should check term_id rather than term_taxonomy_id.

Merges [30263] (and [30264] [30401]) to the 4.0 branch.

props boonebgorges.
fixes #29663, see #22112.

Built from https://develop.svn.wordpress.org/branches/4.0@30405


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-11-20 10:59:35 +00:00
parent 59ae9aa3a7
commit 0e76113043
1 changed files with 1 additions and 1 deletions

View File

@ -1513,7 +1513,7 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo
}
if ( ! empty( $excluded_terms ) ) {
$where .= " AND p.ID NOT IN ( SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . implode( $excluded_terms, ',' ) . ') )';
$where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (" . implode( $excluded_terms, ',' ) . ') )';
}
}