WordPress.org

Make WordPress Core

Changeset 11420


Ignore:
Timestamp:
05/21/09 00:10:04 (6 years ago)
Author:
ryan
Message:

Revert [11392]. It breaks custom taxonomies for attachments. see #8731

File:
1 edited

Legend:

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

    r11415 r11420  
    15831583        $groupby = ''; 
    15841584        $fields = "$wpdb->posts.*"; 
     1585        $post_status_join = false; 
    15851586        $page = 1; 
    15861587 
     
    19581959                    $post_type = 'any'; 
    19591960                    $q['post_status'] = 'publish'; 
     1961                    $post_status_join = true; 
    19601962                } else { 
    19611963                    $whichcat = " AND 0 "; 
     
    21112113                else 
    21122114                    $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")"; 
     2115            } 
     2116            if ( $post_status_join ) { 
     2117                $join .= " JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) "; 
     2118                foreach ( $statuswheres as $index => $statuswhere ) 
     2119                    $statuswheres[$index] = "($statuswhere OR ($wpdb->posts.post_status = 'inherit' AND " . str_replace($wpdb->posts, 'p2', $statuswhere) . "))"; 
    21132120            } 
    21142121            foreach ( $statuswheres as $statuswhere ) 
Note: See TracChangeset for help on using the changeset viewer.