WP_Tax_Query::sanitize_relation

Advertisement

Summery Summery

Sanitize a ‘relation’ operator.

Syntax Syntax

WP_Tax_Query::sanitize_relation( string $relation )

Parameters Parameters

$relation

(Required) Raw relation key from the query argument.

Return Return

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

Source Source

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

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

Advertisement

Changelog Changelog

Changelog
Version Description
4.1.0 Introduced.

Advertisement

Leave a Reply