WordPress.org

Make WordPress Core

Ticket #5248: 5248.diff

File 5248.diff, 992 bytes (added by westi, 11 years ago)

Patch against trunk

  • wp-includes/query.php

     
    974974                        $q['cat'] = $reqcat;
    975975
    976976                        $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                         $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
     977                        $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
    978978                        $in_cats = array($q['cat']);
    979979                        $in_cats = array_merge($in_cats, get_term_children($q['cat'], 'category'));
    980980                        $in_cats = "'" . implode("', '", $in_cats) . "'";
     
    10581058                        if ( count($post_ids) )
    10591059                                $whichcat .= " AND $wpdb->posts.ID IN (" . implode(', ', $post_ids) . ") ";
    10601060                        else {
    1061                                 $whichcat = " AND 0 = 1";
     1061                                $whichcat .= " AND 0 = 1";
    10621062                                break;
    10631063                        }
    10641064                }