Tribe__Repository__Query_Filters::where( string $where_clause, null|string $id = null, boolean $override = false )
Add a custom WHERE clause to the query.
Contents
Parameters
- $where_clause
-
(string) (Required)
- $id
-
(null|string) (Optional) WHERE ID to prevent duplicating clauses.
Default value: null
- $override
-
(boolean) (Optional) Whether to override the clause if a WHERE by the same ID exists or not.
Default value: false
Source
File: src/Tribe/Repository/Query_Filters.php
public function where( $where_clause ) {
if ( $this->buffer_where_clauses ) {
$this->buffered_where_clauses[] = '(' . $where_clause . ')';
} else {
$this->query_vars['where'][] = '(' . $where_clause . ')';
if ( ! has_filter( 'posts_where', array( $this, 'filter_posts_where' ) ) ) {
add_filter( 'posts_where', array( $this, 'filter_posts_where' ), 10, 2 );
}
}
}
Changelog
| Version | Description |
|---|---|
| 4.9.14 | Added the $id and $override parameters. |
| 4.7.19 | Introduced. |