From f882fc1295f5a352a29e35f453844747a56049bc Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 7 Dec 2016 15:52:44 +0000 Subject: [PATCH] Comments: Clean up unused code after [38446]. When the direct SQL query was removed in [38446], part of the SQL concatenation was not removed. This changeset fixes that. Props david.binda. Fixes #39142. Built from https://develop.svn.wordpress.org/trunk@39532 git-svn-id: http://core.svn.wordpress.org/trunk@39472 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-comment-query.php | 23 +---------------------- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/wp-includes/class-wp-comment-query.php b/wp-includes/class-wp-comment-query.php index ef8b6d545b..25b7fcf1a8 100644 --- a/wp-includes/class-wp-comment-query.php +++ b/wp-includes/class-wp-comment-query.php @@ -946,33 +946,12 @@ class WP_Comment_Query { 0 => wp_list_pluck( $comments, 'comment_ID' ), ); - /* - * The WHERE clause for the descendant query is the same as for the top-level - * query, minus the `parent`, `parent__in`, and `parent__not_in` sub-clauses. - */ - $_where = $this->filtered_where_clause; - $exclude_keys = array( 'parent', 'parent__in', 'parent__not_in' ); - foreach ( $exclude_keys as $exclude_key ) { - if ( isset( $this->sql_clauses['where'][ $exclude_key ] ) ) { - $clause = $this->sql_clauses['where'][ $exclude_key ]; - - // Strip the clause as well as any adjacent ANDs. - $pattern = '|(?:AND)?\s*' . $clause . '\s*(?:AND)?|'; - $_where_parts = preg_split( $pattern, $_where ); - - // Remove empties. - $_where_parts = array_filter( array_map( 'trim', $_where_parts ) ); - - // Reassemble with an AND. - $_where = implode( ' AND ', $_where_parts ); - } - } - $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); $last_changed = wp_cache_get_last_changed( 'comment' ); // Fetch an entire level of the descendant tree at a time. $level = 0; + $exclude_keys = array( 'parent', 'parent__in', 'parent__not_in' ); do { // Parent-child relationships may be cached. Only query for those that are not. $child_ids = $uncached_parent_ids = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 2deac0201b..e571404f19 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39531'; +$wp_version = '4.8-alpha-39532'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.