Make WordPress Core


Ignore:
Timestamp:
12/03/2015 03:49:37 PM (9 years ago)
Author:
boonebgorges
Message:

Ensure that order is specified when querying for comment descendants.

Props tellyworth.
Fixes #34838.

File:
1 edited

Legend:

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

    r35512 r35757  
    884884
    885885            $where = 'WHERE ' . implode( ' AND ', $where_clauses ) . ' AND comment_parent IN (' . implode( ',', array_map( 'intval', $parent_ids ) ) . ')';
    886             $comment_ids = $wpdb->get_col( "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']}" );
     886            $comment_ids = $wpdb->get_col( "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} ORDER BY comment_date_gmt ASC, comment_ID ASC" );
    887887
    888888            $level++;
Note: See TracChangeset for help on using the changeset viewer.