WP_Tax_Query::sanitize_relation( string $relation )

Sanitize a ‘relation’ operator.


Parameters Parameters

$relation

(string) (Required) Raw relation key from the query argument.


Top ↑

Return Return

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


Top ↑

Source Source

File: wp-includes/class-wp-tax-query.php

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


Top ↑

Changelog Changelog

Changelog
Version Description
4.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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