Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Query::get_tax_query( array $query = array() )
Get a taxonomy query that filters out courses & memberships based on catalog / search visibility settings
Parameters Parameters
- $query
-
(array) (Optional) Existing taxonomy query from the global $wp_query.
Default value: array()
Return Return
(array)
Source Source
File: includes/class.llms.query.php
private function get_tax_query( $query = array() ) { if ( ! is_array( $query ) ) { $query = array( 'relation' => 'AND', ); } $terms = wp_list_pluck( get_terms( array( 'taxonomy' => 'llms_product_visibility', 'hide_empty' => false, ) ), 'term_taxonomy_id', 'name' ); $not_in = ( is_search() ) ? array( $terms['hidden'], $terms['catalog'] ) : array( $terms['hidden'], $terms['search'] ); $query[] = array( 'field' => 'term_taxonomy_id', 'operator' => 'NOT IN', 'taxonomy' => 'llms_product_visibility', 'terms' => $not_in, ); return $query; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |