Changeset 6253 for branches/2.3/wp-includes/query.php
- Timestamp:
- 10/15/2007 08:14:56 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/wp-includes/query.php
r6190 r6253 933 933 934 934 if ( !empty($q['category__in']) ) { 935 $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFTJOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";935 $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; 936 936 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' "; 937 937 $include_cats = "'" . implode("', '", $q['category__in']) . "'"; … … 974 974 $q['cat'] = $reqcat; 975 975 976 $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFTJOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";976 $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; 977 977 $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' "; 978 978 $in_cats = array($q['cat']); … … 1016 1016 1017 1017 if ( !empty($q['tag__in']) ) { 1018 $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFTJOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";1018 $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; 1019 1019 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; 1020 1020 $include_tags = "'" . implode("', '", $q['tag__in']) . "'"; … … 1026 1026 1027 1027 if ( !empty($q['tag_slug__in']) ) { 1028 $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) LEFTJOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) ";1028 $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) INNER JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) "; 1029 1029 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; 1030 1030 $include_tags = "'" . implode("', '", $q['tag_slug__in']) . "'"; … … 1057 1057 1058 1058 $q[$item] = array_unique($q[$item]); 1059 $tsql = "SELECT p.ID FROM $wpdb->posts p LEFT JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) LEFTJOIN $wpdb->terms t ON (tt.term_id = t.term_id)";1059 $tsql = "SELECT p.ID FROM $wpdb->posts p INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) INNER JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) INNER JOIN $wpdb->terms t ON (tt.term_id = t.term_id)"; 1060 1060 $tsql .= " WHERE tt.taxonomy = '$taxonomy' AND t.$taxonomy_field IN ('" . implode("', '", $q[$item]) . "')"; 1061 1061 $tsql .= " GROUP BY p.ID HAVING count(p.ID) = " . count($q[$item]);
Note: See TracChangeset
for help on using the changeset viewer.