On this page
WP_Date_Query::sanitize_relation( string $relation ): string
Sanitizes a ‘relation’ operator.
Parameters
$relationstring Required-
Raw relation key from the query argument.
Return
string Sanitized relation ('AND' or 'OR').
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';
}
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Date_Query::sanitize_query() wp-includes/class-wp-date-query.php | Recursive-friendly query sanitizer. |
| WP_Date_Query::__construct() wp-includes/class-wp-date-query.php | Constructor. |
Changelog
| Version | Description |
|---|---|
| 6.0.3 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_date_query/sanitize_relation