WP_Tax_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. Either 'AND' or 'OR'.

Source

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

Changelog

VersionDescription
4.1.0Introduced.

User Contributed Notes

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