Comments: Revert [38497]
Restore direct SQL query when fetching descendants. See #37696, #37966. Built from https://develop.svn.wordpress.org/branches/4.6@38537 git-svn-id: http://core.svn.wordpress.org/branches/4.6@38480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1df764bd45
commit
927e102a78
|
@ -995,16 +995,8 @@ class WP_Comment_Query {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $uncached_parent_ids ) {
|
if ( $uncached_parent_ids ) {
|
||||||
// Fetch this level of comments.
|
$where = 'WHERE ' . $_where . ' AND comment_parent IN (' . implode( ',', array_map( 'intval', $uncached_parent_ids ) ) . ')';
|
||||||
$parent_query_args = $this->query_vars;
|
$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" );
|
||||||
foreach ( $exclude_keys as $exclude_key ) {
|
|
||||||
$parent_query_args[ $exclude_key ] = '';
|
|
||||||
}
|
|
||||||
$parent_query_args['parent__in'] = $uncached_parent_ids;
|
|
||||||
$parent_query_args['no_found_rows'] = true;
|
|
||||||
$parent_query_args['hierarchical'] = false;
|
|
||||||
|
|
||||||
$level_comments = get_comments( $parent_query_args );
|
|
||||||
|
|
||||||
// Cache parent-child relationships.
|
// Cache parent-child relationships.
|
||||||
$parent_map = array_fill_keys( $uncached_parent_ids, array() );
|
$parent_map = array_fill_keys( $uncached_parent_ids, array() );
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.6.1-RC1-38525';
|
$wp_version = '4.6.1-RC1-38537';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue