Sanitizes a ‘relation’ operator.
$relationstringrequired
'AND' or 'OR'.public function sanitize_relation( $relation ) {
if ( 'OR' === strtoupper( $relation ) ) {
return 'OR';
} else {
return 'AND';
}
}
| Version | Description |
|---|---|
| 6.0.3 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_date_query/sanitize_relation