WordPress.org

Make WordPress Core

Ticket #5248: 13682.diff

File 13682.diff, 1001 bytes (added by jaroche, 8 years ago)

Patch against /trunk

  • wp-includes/query.php

     
    18751875                        $q['cat'] = $reqcat;
    18761876
    18771877                        $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) ";
    1878                         $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
     1878                        $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
    18791879                        $in_cats = array($q['cat']);
    18801880                        $in_cats = array_merge($in_cats, get_term_children($q['cat'], 'category'));
    18811881                        $in_cats = "'" . implode("', '", $in_cats) . "'";
     
    19611961                        if ( count($post_ids) )
    19621962                                $whichcat .= " AND $wpdb->posts.ID IN (" . implode(', ', $post_ids) . ") ";
    19631963                        else {
    1964                                 $whichcat = " AND 0 = 1";
     1964                                $whichcat .= " AND 0 = 1";
    19651965                                break;
    19661966                        }
    19671967                }