Categories::ap_main_questions_args( array $args )
Description #
Filter main questions query args. Modify and add category args.
Parameters #
- $argsarray (Required) Questions args.
Source #
File: addons/categories/categories.php
public function ap_main_questions_args( $args ) { global $wp; $query = $wp->query_vars; $categories_operator = ! empty( $wp->query_vars['ap_categories_operator'] ) ? $wp->query_vars['ap_categories_operator'] : 'IN'; $current_filter = ap_get_current_list_filters( 'category' ); if ( isset( $query['ap_categories'] ) && is_array( $query['ap_categories'] ) ) { $args['tax_query'][] = array( 'taxonomy' => 'question_category', 'field' => 'slug', 'terms' => $query['ap_categories'], 'operator' => $categories_operator, ); } elseif ( ! empty( $current_filter ) ) { $args['tax_query'][] = array( 'taxonomy' => 'question_category', 'field' => 'term_id', 'terms' => explode( ',', sanitize_comma_delimited( $current_filter ) ), ); } return $args; }
Expand full source code Collapse full source code View on GitHub: addons/categories/categories.php:785
Add your comment