AnsPress_Tag::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/free/tag.php
public static 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, ); } return $args; }
Expand full source code Collapse full source code View on GitHub: addons/free/tag.php:490
Add your comment