WP_Date_Query::get_compare( array $query )

Determines and validates what comparison operator to use.


Description Description


Parameters Parameters

$query

(array) (Required) A date query or a date subquery.


Top ↑

Return Return

(string) The comparison operator.


Top ↑

Source 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' ) ) ) {
			return strtoupper( $query['compare'] );
		}

		return $this->compare;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.