Ticket #22112: 22112.4.patch
| File 22112.4.patch, 1.2 KB (added by , 11 years ago) |
|---|
-
src/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 ))1510 if ( ! $term_array ) 1508 1511 return ''; 1509 1512 1510 1513 $where .= " AND tt.term_id IN (" . implode( ',', $term_array ) . ")"; 1511 1514 } 1512 1515 1513 1516 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, ',' ) . ') )'; 1517 $join .= " LEFT JOIN $wpdb->term_relationships AS tr2 ON p.ID = tr2.object_id AND tr2.term_taxonomy_id IN (" . implode( ',', $excluded_terms ) . ")"; 1518 $where .= " AND tr2.object_id IS NULL"; 1515 1519 } 1516 1520 } 1517 1521