Ticket #22112: 22112.3.patch
| File 22112.3.patch, 1.1 KB (added by , 11 years ago) |
|---|
-
wp-includes/link-template.php
1500 1500 return ''; 1501 1501 $term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); 1502 1502 1503 if ( ! $term_array || is_wp_error( $term_array ) ) 1504 return ''; 1505 1503 1506 // Remove any exclusions from the term array to include. 1504 1507 $term_array = array_diff( $term_array, (array) $excluded_terms ); 1505 1508 $term_array = array_map( 'intval', $term_array ); 1506 1509 1507 if ( ! $term_array || is_wp_error( $term_array ) )1508 return '';1509 1510 1510 $where .= " AND tt.term_id IN (" . implode( ',', $term_array ) . ")"; 1511 1511 } 1512 1512 1513 1513 if ( ! empty( $excluded_terms ) ) { 1514 $where .= " AND p.ID NOT IN ( SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . implode( $excluded_terms, ',' ) . ') )';1514 $where .= $wpdb->prepare( " AND tt.taxonomy = %s AND tt.term_id NOT IN (" . implode( $excluded_terms, ',' ) . ')', $taxonomy ); 1515 1515 } 1516 1516 } 1517 1517