Make WordPress Core

Ticket #22112: 22112.3.patch

File 22112.3.patch, 1.1 KB (added by betzster, 11 years ago)
  • wp-includes/link-template.php

     
    15001500                                return '';
    15011501                        $term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
    15021502
     1503                        if ( ! $term_array || is_wp_error( $term_array ) )
     1504                                return '';
     1505
    15031506                        // Remove any exclusions from the term array to include.
    15041507                        $term_array = array_diff( $term_array, (array) $excluded_terms );
    15051508                        $term_array = array_map( 'intval', $term_array );
    15061509
    1507                         if ( ! $term_array || is_wp_error( $term_array ) )
    1508                                 return '';
    1509 
    15101510                        $where .= " AND tt.term_id IN (" . implode( ',', $term_array ) . ")";
    15111511                }
    15121512
    15131513                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 );
    15151515                }
    15161516        }
    15171517