id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 30778 Extend WP_Query to allow for querys of posts with attachments with certain metadata pampfelimetten "Currently, if you want to find posts with attachments with certain meta data, you have to use two different queries. One for all the attachments with the right metadata, then collect the parent Ids, and a second query where you set the 'post__in' argument. This works, but it is clumsy to solve this in php. It would be great if you could set off something like: {{{ $args['post_type'] = 'post'; $args['post_status'] = 'publish'; $args['s'] = 'searchtext'; $args['child_query']['post_type'] = 'attachment'; $args['child_query']['post_status'] = 'inherit'; $args['child_query']['posts_per_page'] = '-1'; $args['child_query']['post_mime_type'] = 'audio'; }}} This way, you could easily query for posts with certain attachment meta data, for example for a post with mp3s with a bitrate higher than 128kb. Take a look at our site if you want to see a real life use case: http://cba.fro.at/search Our users can set off quite complex querys with multiple metadata specification, some of which is saved as metadata of posts, some of which is saved as metadata of attachments of these posts. But us I said, we have to split it into two queries at the moment." enhancement closed normal Query 4.1 normal wontfix