WP_Date_Query::get_compare() WordPress Method
The WP_Date_Query::get_compare() method is used to get the comparison operator for a given date query.
WP_Date_Query::get_compare( array $query ) #
Determines and validates what comparison operator to use.
Parameters
- $query
(array)(Required)A date query or a date subquery.
Return
(string) The comparison operator.
Source
File: wp-includes/class-wp-date-query.php
public function get_compare( $query ) { if ( ! empty( $query['compare'] ) && in_array( $query['compare'], array( '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) { return strtoupper( $query['compare'] ); } return $this->compare; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |