Skip to content

Commit

Permalink
Merge pull request #15 from hughc/master
Browse files Browse the repository at this point in the history
fix(app) Fix filter Walker failing when taxonomies have query_var set, see #15

Use the query var from the full taxonomy object instead of the taxonomy name
Account for custom taxonomies

Props @hughc
  • Loading branch information
franz-josef-kaiser committed Mar 16, 2016
2 parents ee00a0e + e9dfd11 commit 6976576
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions inc/filter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public function get_markup()
{
$walker = new WCMF_walker;
foreach ( $this->taxonomies as $tax )
{
{
$fullTax = get_taxonomy( $tax );
$qString = isset($fullTax->query_var) ? $fullTax->query_var : $tax;
wp_dropdown_categories( array(
'taxonomy' => $tax
,'hide_if_empty' => true
Expand All @@ -47,10 +49,10 @@ public function get_markup()
,'hierarchical' => is_taxonomy_hierarchical( $tax )
,'show_count' => true
,'orderby' => 'name'
,'selected' => '0' !== get_query_var( $tax )
? get_query_var( $tax )
,'selected' => '0' !== get_query_var( $qString )
? get_query_var( $qString )
: false
,'name' => $tax
,'name' => $qString
,'id' => $tax
,'walker' => $walker
) );
Expand Down

0 comments on commit 6976576

Please sign in to comment.