[wp-trac] [WordPress Trac] #19148: get_post_types returning more than desired, custom post type objects contain taxonomies

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 14 21:32:11 UTC 2011


#19148: get_post_types returning more than desired, custom post type objects
contain taxonomies
--------------------------+-------------------------
 Reporter:  Ov3rfly       |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Post Types    |     Version:  3.2.1
 Severity:  normal        |  Resolution:  worksforme
 Keywords:                |
--------------------------+-------------------------
Changes (by nacin):

 * status:  reopened => closed
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Replying to [comment:7 MZAWeb]:
 > Replying to [comment:3 nacin]:
 > > This data ia stored in only one place (in the taxonomy object) for a
 reason.
 > What would that reason be? (just asking, really)

 You don't want to store data in two places. This means you then need to
 sync the data.

 > Replying to [comment:5 Ov3rfly]:
 > > It seems that builtin post types do not contain taxonomies in the post
 type objects returned by get_post_types(), but custom post types do. This
 is not consistent.
 > I'm seeing the same behavior. My patch fixes that.

 The correct fix would be to unset($args->taxonomies) before shoving the
 data into $wp_post_types. It's probably too late at this point as some
 plugin will likely break, but the point is, this isn't the right place to
 look for this data. It was purely a registration argument.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19148#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list