Make WordPress Core


Ignore:
Timestamp:
05/19/2009 03:25:43 PM (15 years ago)
Author:
ryan
Message:

Lose broken post_status_join. Exclude revisions from post_type = any queries. Props gortsleigh. fixes #8731

File:
1 edited

Legend:

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

    r11386 r11392  
    15831583        $groupby = '';
    15841584        $fields = "$wpdb->posts.*";
    1585         $post_status_join = false;
    15861585        $page = 1;
    15871586
     
    19591958                    $post_type = 'any';
    19601959                    $q['post_status'] = 'publish';
    1961                     $post_status_join = true;
    19621960                } else {
    19631961                    $whichcat = " AND 0 ";
     
    20662064
    20672065        if ( 'any' == $post_type ) {
    2068             $where .= '';
     2066            $where .= " AND $wpdb->posts.post_type != 'revision'";
    20692067        } elseif ( $this->is_attachment ) {
    20702068            $where .= " AND $wpdb->posts.post_type = 'attachment'";
     
    21112109                else
    21122110                    $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")";
    2113             }
    2114             if ( $post_status_join ) {
    2115                 $join .= " JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) ";
    2116                 foreach ( $statuswheres as $index => $statuswhere )
    2117                     $statuswheres[$index] = "($statuswhere OR ($wpdb->posts.post_status = 'inherit' AND " . str_replace($wpdb->posts, 'p2', $statuswhere) . "))";
    21182111            }
    21192112            foreach ( $statuswheres as $statuswhere )
Note: See TracChangeset for help on using the changeset viewer.