Changeset 39532
- Timestamp:
- 12/07/2016 03:51:08 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment-query.php
r39274 r39532 947 947 ); 948 948 949 /*950 * The WHERE clause for the descendant query is the same as for the top-level951 * query, minus the `parent`, `parent__in`, and `parent__not_in` sub-clauses.952 */953 $_where = $this->filtered_where_clause;954 $exclude_keys = array( 'parent', 'parent__in', 'parent__not_in' );955 foreach ( $exclude_keys as $exclude_key ) {956 if ( isset( $this->sql_clauses['where'][ $exclude_key ] ) ) {957 $clause = $this->sql_clauses['where'][ $exclude_key ];958 959 // Strip the clause as well as any adjacent ANDs.960 $pattern = '|(?:AND)?\s*' . $clause . '\s*(?:AND)?|';961 $_where_parts = preg_split( $pattern, $_where );962 963 // Remove empties.964 $_where_parts = array_filter( array_map( 'trim', $_where_parts ) );965 966 // Reassemble with an AND.967 $_where = implode( ' AND ', $_where_parts );968 }969 }970 971 949 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 972 950 $last_changed = wp_cache_get_last_changed( 'comment' ); … … 974 952 // Fetch an entire level of the descendant tree at a time. 975 953 $level = 0; 954 $exclude_keys = array( 'parent', 'parent__in', 'parent__not_in' ); 976 955 do { 977 956 // Parent-child relationships may be cached. Only query for those that are not.
Note: See TracChangeset
for help on using the changeset viewer.