| @@ 1165-1171 (lines=7) @@ | ||
| 1162 | } |
|
| 1163 | } |
|
| 1164 | ||
| 1165 | if( $question_type ) { |
|
| 1166 | $args['tax_query'][] = array( |
|
| 1167 | 'taxonomy' => 'question-type', |
|
| 1168 | 'field' => 'slug', |
|
| 1169 | 'terms' => $question_type, |
|
| 1170 | ); |
|
| 1171 | } |
|
| 1172 | ||
| 1173 | if( $question_category ) { |
|
| 1174 | $args['tax_query'][] = array( |
|
| @@ 1173-1179 (lines=7) @@ | ||
| 1170 | ); |
|
| 1171 | } |
|
| 1172 | ||
| 1173 | if( $question_category ) { |
|
| 1174 | $args['tax_query'][] = array( |
|
| 1175 | 'taxonomy' => 'question-category', |
|
| 1176 | 'field' => 'slug', |
|
| 1177 | 'terms' => $question_category, |
|
| 1178 | ); |
|
| 1179 | } |
|
| 1180 | ||
| 1181 | if( $question_type && $question_category ) { |
|
| 1182 | $args['tax_query']['relation'] = 'AND'; |
|
| @@ 318-325 (lines=8) @@ | ||
| 315 | ||
| 316 | // Question type |
|
| 317 | $question_type = isset( $_GET['question_type'] ) ? $_GET['question_type'] : ''; |
|
| 318 | if( $question_type ) { |
|
| 319 | $type_query = array( |
|
| 320 | 'taxonomy' => 'question-type', |
|
| 321 | 'terms' => $question_type, |
|
| 322 | 'field' => 'slug', |
|
| 323 | ); |
|
| 324 | $request['tax_query'][] = $type_query; |
|
| 325 | } |
|
| 326 | ||
| 327 | // Question category |
|
| 328 | $question_cat = isset( $_GET['question_cat'] ) ? $_GET['question_cat'] : ''; |
|
| @@ 329-336 (lines=8) @@ | ||
| 326 | ||
| 327 | // Question category |
|
| 328 | $question_cat = isset( $_GET['question_cat'] ) ? $_GET['question_cat'] : ''; |
|
| 329 | if( $question_cat ) { |
|
| 330 | $cat_query = array( |
|
| 331 | 'taxonomy' => 'question-category', |
|
| 332 | 'terms' => $question_cat, |
|
| 333 | 'field' => 'slug', |
|
| 334 | ); |
|
| 335 | $request['tax_query'][] = $cat_query; |
|
| 336 | } |
|
| 337 | } |
|
| 338 | ||
| 339 | return $request; |
|