Make WordPress Core


Ignore:
Timestamp:
12/15/2009 09:01:57 PM (14 years ago)
Author:
ryan
Message:

Remove no longer needed DB has_cap() checks. Props filosofo. fixes #11443

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r12393 r12409  
    17851785
    17861786        if ( !empty($q['category__not_in']) ) {
    1787             if ( $wpdb->has_cap( 'subqueries' ) ) {
    1788                 $cat_string = "'" . implode("', '", $q['category__not_in']) . "'";
    1789                 $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ($cat_string) )";
    1790             } else {
    1791                 $ids = get_objects_in_term($q['category__not_in'], 'category');
    1792                 if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 )
    1793                     $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')";
    1794             }
     1787            $cat_string = "'" . implode("', '", $q['category__not_in']) . "'";
     1788            $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ($cat_string) )";
    17951789        }
    17961790
     
    18751869
    18761870        if ( !empty($q['tag__not_in']) ) {
    1877             if ( $wpdb->has_cap( 'subqueries' ) ) {
    1878                 $tag_string = "'" . implode("', '", $q['tag__not_in']) . "'";
    1879                 $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'post_tag' AND tt.term_id IN ($tag_string) )";
    1880             } else {
    1881                 $ids = get_objects_in_term($q['tag__not_in'], 'post_tag');
    1882                 if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 )
    1883                     $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')";
    1884             }
     1871            $tag_string = "'" . implode("', '", $q['tag__not_in']) . "'";
     1872            $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'post_tag' AND tt.term_id IN ($tag_string) )";
    18851873        }
    18861874
Note: See TracChangeset for help on using the changeset viewer.