WP_Date_Query::sanitize_relation( string $relation ): string

Sanitizes a ‘relation’ operator.


Parameters

$relation string Required
Raw relation key from the query argument.

Top ↑

Return

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


Top ↑

Source

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

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


Top ↑

Changelog

Changelog
Version Description
6.0.3 Introduced.

Top ↑

User Contributed Notes

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