Improve post-filter sanitization of excluded terms in `get_adjacent_post()`.
See [36078], #35211. git-svn-id: https://develop.svn.wordpress.org/trunk@36079 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fff6412f91
commit
9c2d3a7a4d
|
@ -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 ) ) . ') )';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue