Tags::ap_main_questions_args( array $args )
Description #
Filter main questions query args. Modify and add tags args.
Parameters #
- $argsarray (Required) Questions args.
Source #
File: addons/tags/tags.php
public function ap_main_questions_args( $args ) { global $wp; $query = $wp->query_vars; $current_filter = ap_get_current_list_filters( 'qtag' ); $tags_operator = ! empty( $wp->query_vars['ap_tags_operator'] ) ? $wp->query_vars['ap_tags_operator'] : 'IN'; if ( isset( $query['ap_tags'] ) && is_array( $query['ap_tags'] ) ) { $args['tax_query'][] = array( 'taxonomy' => 'question_tag', 'field' => 'slug', 'terms' => $query['ap_tags'], 'operator' => $tags_operator, ); } elseif ( ! empty( $current_filter ) ) { $args['tax_query'][] = array( 'taxonomy' => 'question_tag', 'field' => 'term_id', 'terms' => $current_filter, 'operator' => 'IN', ); } return $args; }
Expand full source code Collapse full source code View on GitHub: addons/tags/tags.php:560
Add your comment