﻿id,summary,reporter,owner,description,type,status,priority,mile
stone,component,version,severity,resolution,keywords,cc,focuses
22556,A taxonomy archive query for attachments can't return
results,ocean90,,"In #21391 we made it easier to use custom
taxonomies for attachments. Example: {{{ function
ds_register_attachment_taxonomies() { $args = array( 'label' =>
'Color', ); register_taxonomy( 'image-color',
'attachment:image', $args ); } add_action( 'init',
'ds_register_attachment_taxonomies' ); }}} This makes it also
possible to make a query for this specific taxonomy. Example: 5
images has the term ""red"". The query:
!http://example.com/image-color/red/ But: The page returns no
attachments. The query: {{{ SELECT SQL_CALC_FOUND_ROWS
wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON
(wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (404) ) AND
wp_posts.post_type IN ('attachment') AND (wp_posts.post_status =
'publish' OR wp_posts.post_status = '