PHP Class EP_WP_Date_Query

Inheritance: extends WP_Date_Query
Mostrar archivo Open project: 10up/elasticpress Class Usage Examples

Public Properties

Property Type Description
$time_keys array Introduced in WP 4.1 added here for backwards compatibility

Public Methods

Method Description
get_es_filter ( ) : array Like WP_Date_Query::get_sql takes WP_Date_Query class queries and returns ES filter arrays
simple_es_date_filter ( $args ) : array | boolean Takes WP_Query args, and returns ES filters for query Support for older style WP_Query date params
validate_date_values ( $date_query = [] ) Introduced in WP 4.1 added here for backwards compatibility

Protected Methods

Method Description
build_es_date_term_filter ( array $date_term_filters = [], string $type = 'AND' ) : array Takes array of date term filters and groups them into a filter based on relationship type
build_es_range_filter ( array $range_filters = [] ) : array Takes array of range filters and groups them into a single filter
get_es_filter_for_clause ( $query ) : array Takes SQL query part, and translates it into an ES filter
get_es_filter_for_clauses ( ) : array Like WP_Date_Query::get_sql_for_clauses takes all queries in WP_Date_Query object and gets ES filters for each
get_es_filter_for_query ( $query, integer $depth ) : array
is_first_order_clause ( $query ) Introduced in WP 4.1 added here for backwards compatibility

Method Details

build_es_date_term_filter() protected method

Takes array of date term filters and groups them into a filter based on relationship type
Since: 0.1.4
protected build_es_date_term_filter ( array $date_term_filters = [], string $type = 'AND' ) : array
$date_term_filters array
$type string type of relationship between date term filters (AND, OR)
return array

build_es_range_filter() protected method

Takes array of range filters and groups them into a single filter
Since: 0.1.4
protected build_es_range_filter ( array $range_filters = [] ) : array
$range_filters array
return array

get_es_filter() public method

Like WP_Date_Query::get_sql takes WP_Date_Query class queries and returns ES filter arrays
Since: 0.1.4
public get_es_filter ( ) : array
return array

get_es_filter_for_clause() protected method

Takes SQL query part, and translates it into an ES filter
protected get_es_filter_for_clause ( $query ) : array
$query
return array ES filter

get_es_filter_for_clauses() protected method

Like WP_Date_Query::get_sql_for_clauses takes all queries in WP_Date_Query object and gets ES filters for each
Since: 0.1.4
protected get_es_filter_for_clauses ( ) : array
return array

get_es_filter_for_query() protected method

Since: 0.1.4
protected get_es_filter_for_query ( $query, integer $depth ) : array
$query array of date query clauses
$depth integer unused but may be necessary if we do nested date queries
return array

is_first_order_clause() protected method

Introduced in WP 4.1 added here for backwards compatibility
protected is_first_order_clause ( $query )

simple_es_date_filter() static public method

Takes WP_Query args, and returns ES filters for query Support for older style WP_Query date params
static public simple_es_date_filter ( $args ) : array | boolean
$args
return array | boolean

validate_date_values() public method

Introduced in WP 4.1 added here for backwards compatibility
public validate_date_values ( $date_query = [] )

Property Details

$time_keys public_oe property

Introduced in WP 4.1 added here for backwards compatibility
public array $time_keys
return array