Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

After reading through this fantastic tutorial by Mike Schinkel:

Adding a Taxonomy Filter to Admin List for a Custom Post Type?

I have discovered a few issues that I need to work out. Search does not seem to work properly with custom taxonomy filters applied. Also, if I output more than one custom taxonomy filter dropdown, what's the best way to prevent a user from specifying values for more than one of the dropdowns? I'm thinking I should just add a JavaScript function, but it might have to be a dynamically generated JavaScript function.

I really want to tackle the search issue first, though.

Any thoughts? Thanks for your help, Dave Morris

share|improve this question

1 Answer 1

Figured this out by using this code:

function override_is_tax_on_post_search($query) {
        global $pagenow;
        $qv = &$query->query_vars;
        if ($pagenow == 'edit.php' && isset($qv['taxonomy']) && isset($qv['s'])) {
            $query->is_tax = true;
        }
    }
}
add_filter('parse_query','override_is_tax_on_post_search');
share|improve this answer
    
If that's based on Mike's code, it's missing the code that switches the term id for a slug(which is required for the filter to work, unless you render the dropdown differently).. note: there's an error in your code(extra curly brace).. Your fix however, does work... :) –  t31os Dec 23 '10 at 17:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.