﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
21290,Post types continue to be selected after removal from custom taxonomy registration,jondavidjohn,jondavidjohn,"== Bug ==

Post's appear in the archive view for custom taxonomies that have post types that are not registered for the given custom taxonomy.

This happens when a post type is removed from the taxonomy registration that currently has posts with said post type with associated taxonomies applied.  It doesn't seem like it should be assumed that taxonomy registration will always be handled in a static programmatic way that will never change.

== Reproduce ==

1.  Create a custom taxonomy registration for 'post' and 'page' post types
2.  Add a few posts and pages to one of these custom taxonomies
3.  Check and make sure these posts/pages are showing up on the custom taxonomy archive page
4.  Now remove 'page' from the taxonomy registration
5. Confirm that it is removed in the admin menus and page edit screen.
6. Go back to the taxonomy archive page and you will see the pages you added still show up in the loop, now unable to manually remove the taxonomy term in the admin.

== Solution ==

Currently the query for a custom taxonomy defaults to 'any' post type with the taxonomy applied, if a post type has not been filtered in at this point. (query.php:2217)

My proposed solution would be to recognize the taxonomy applied and use the post type registration to make the default post type selection, instead of assuming 'any'.

This will prevent the situation of orphaned posts still showing up in custom taxonomy archives even after their post type is removed from the registration.
",defect (bug),closed,normal,3.5,Taxonomy,3.4.1,major,fixed,close,ejdanderson@…
