WP_Date_Query::get_compare( array $query ): string

Determines and validates what comparison operator to use.


Parameters

$query array Required
A date query or a date subquery.

Top ↑

Return

string The comparison operator.


Top ↑

Source

File: wp-includes/class-wp-date-query.php. View all references

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;
}


Top ↑

Changelog

Changelog
Version Description
3.7.0 Introduced.

Top ↑

User Contributed Notes

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