diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 5d88bd60c3..ca6ccfcf88 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -1614,7 +1614,7 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms ); if ( ! empty( $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, ',' ) . ') )'; + $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( ',', array_map( 'intval', $excluded_terms ) ) . ') )'; } }