Title: Terms selected in wrong (multiple) taxonomy dropdowns
Last modified: June 4, 2018

---

# Terms selected in wrong (multiple) taxonomy dropdowns

 *  Resolved [webfoundry](https://wordpress.org/support/users/webfoundry/)
 * (@webfoundry)
 * [8 years ago](https://wordpress.org/support/topic/terms-selected-in-wrong-multiple-taxonomy-dropdowns/)
 * It looks like you’re checking the full query string in class-beautiful-taxonomy-
   filters-walker.php to determine whether a given term is selected which works 
   fine unless you have the same term in two or more taxonomies.
 * (around line 113)
    if ( in_array( $category->slug, $queryvars, true ) ) { $output.
   = ‘ selected=”selected” ‘; }
 * It means if I have custom taxonomies of Foreground colour and Background colour,
   both with white, and I filter Foreground colour on white, both Foreground Colour*
   and Background Colour end up having white selected. It needs to check the taxonomy
   name somewhere in this function – not just all $queryvars for the existence of
   the term.
 * If there’s an easy fix it would great to know about

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [webfoundry](https://wordpress.org/support/users/webfoundry/)
 * (@webfoundry)
 * [8 years ago](https://wordpress.org/support/topic/terms-selected-in-wrong-multiple-taxonomy-dropdowns/#post-10360979)
 * I think the solution looks something like this instead. It’s definitely a bug
   so worth similar might work for future versions.
 *  ` $key=$category->taxonomy;
    if($queryvars[$key]===$category->slug){ $output.
   = ‘ selected=”selected” ‘; }`
 *  Plugin Author [Jonathan de Jong](https://wordpress.org/support/users/jonathandejong/)
 * (@jonathandejong)
 * [8 years ago](https://wordpress.org/support/topic/terms-selected-in-wrong-multiple-taxonomy-dropdowns/#post-10385783)
 * Hi [@webfoundry](https://wordpress.org/support/users/webfoundry/),
 * Thank you for finding this 🙂
    I’ll test it and add it to the next version!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Terms selected in wrong (multiple) taxonomy dropdowns’ is closed to new
replies.

 * ![](https://ps.w.org/beautiful-taxonomy-filters/assets/icon-256x256.png?rev=1654967)
 * [Beautiful taxonomy filters](https://wordpress.org/plugins/beautiful-taxonomy-filters/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/beautiful-taxonomy-filters/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/)
 * [Active Topics](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jonathan de Jong](https://wordpress.org/support/users/jonathandejong/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/terms-selected-in-wrong-multiple-taxonomy-dropdowns/#post-10385783)
 * Status: resolved