WP_Date_Query::sanitize_relation( string $relation ): string

In this article

Sanitizes a ‘relation’ operator.

Parameters

$relationstringrequired
Raw relation key from the query argument.

Return

string Sanitized relation ('AND' or 'OR').

Source

public function sanitize_relation( $relation ) {
	if ( 'OR' === strtoupper( $relation ) ) {
		return 'OR';
	} else {
		return 'AND';
	}
}

Changelog

VersionDescription
6.0.3Introduced.

User Contributed Notes

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