[wp-hackers] query_posts with custom taxonomy and custom post type

Dougal Campbell dougal at gunters.org
Thu Apr 15 19:36:45 UTC 2010


On Apr 15 2010 2:09 PM, Michael Pretty wrote:
> Submit a ticket (and maybe a patch) to trac.  This shouldn't be this way.
>

I agree. Making a query against custom taxonomy and custom post_type 
shouldn't be mutually exclusive. I think we just need to wrap an 'if' 
around that...

   if ( '' === $post_type ) {
     $post_type = 'any';
   }

That way, if the user has specified a particular post type, it will be 
honored, but it will default to 'any'.

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/
http://twitter.com/dougal
http://twitual.com/


More information about the wp-hackers mailing list