WP_Date_Query::get_compare()publicWP 3.7.0

Determines and validates what comparison operator to use.

Метод класса: WP_Date_Query{}

Хуков нет.

Возвращает

Строку. The comparison operator.

Использование

$WP_Date_Query = new WP_Date_Query();
$WP_Date_Query->get_compare( $query );
$query(массив) (обязательный)
A date query or a date subquery.

Список изменений

С версии 3.7.0 Введена.

Код WP_Date_Query::get_compare() WP 6.5.2

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