WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/07/2016 01:40:36 PM (4 years ago)
Author:
jeremyfelt
Message:

Comments: Revert [38497]

Restore direct SQL query when fetching descendants.

See #37696, #37966.

Location:
branches/4.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.6

    • Property svn:mergeinfo changed
      /trunkreverse-merged: 38446
  • branches/4.6/src/wp-includes/class-wp-comment-query.php

    r38497 r38537  
    996996
    997997            if ( $uncached_parent_ids ) {
    998                 // Fetch this level of comments.
    999                 $parent_query_args = $this->query_vars;
    1000                 foreach ( $exclude_keys as $exclude_key ) {
    1001                     $parent_query_args[ $exclude_key ] = '';
    1002                 }
    1003                 $parent_query_args['parent__in']    = $uncached_parent_ids;
    1004                 $parent_query_args['no_found_rows'] = true;
    1005                 $parent_query_args['hierarchical']  = false;
    1006 
    1007                 $level_comments = get_comments( $parent_query_args );
     998                $where = 'WHERE ' . $_where . ' AND comment_parent IN (' . implode( ',', array_map( 'intval', $uncached_parent_ids ) ) . ')';
     999                $level_comments = $wpdb->get_results( "SELECT $wpdb->comments.comment_ID, $wpdb->comments.comment_parent {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} ORDER BY comment_date_gmt ASC, comment_ID ASC" );
    10081000
    10091001                // Cache parent-child relationships.
Note: See TracChangeset for help on using the changeset viewer.