Make WordPress Core


Ignore:
Timestamp:
06/14/2022 04:15:52 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Add a comment for stripping the leading AND from SQL clauses in some query classes.

Follow-up to [30084], [34529], [34542], [36598], [37477], [37572], [43010].

See #55646.

File:
1 edited

Legend:

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

    r53469 r53503  
    912912
    913913        if ( ! empty( $this->query_vars['date_query'] ) && is_array( $this->query_vars['date_query'] ) ) {
    914             $this->date_query                         = new WP_Date_Query( $this->query_vars['date_query'], 'comment_date' );
     914            $this->date_query = new WP_Date_Query( $this->query_vars['date_query'], 'comment_date' );
     915
     916            // Strip leading 'AND'.
    915917            $this->sql_clauses['where']['date_query'] = preg_replace( '/^\s*AND\s*/', '', $this->date_query->get_sql() );
    916918        }
Note: See TracChangeset for help on using the changeset viewer.