[wp-trac] [WordPress Trac] #19148: get_post_types returning more than desired, custom post type objects contain taxonomies (was: get_post_types returning more than desired results, taxonomies arg not respected)

WordPress Trac wp-trac at lists.automattic.com
Sat Nov 5 09:52:17 UTC 2011


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

 * status:  closed => reopened
 * resolution:  worksforme =>


Comment:

 Replying to [comment:1 MZAWeb]:
 > taxonomies is empty for all standard post types in 3.2.1
 It is not for custom post types.

 Replying to [comment:3 nacin]:
 > The post type's `taxonomies` ... It is not something that then ends up
 in the post type object.
 With custom post types the taxonomies end up in the post type object,
 quote from above pastebin:
 {{{
     [location] => stdClass Object
         (
             ...
             [taxonomies] => Array
                 (
                     [0] => category
                     [1] => post_tag
                 )
          ...
     [organisation] => stdClass Object
         (
             ...
             [taxonomies] => Array
                 (
                     [0] => category
                     [1] => post_tag
                 )
 }}}
 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 still consider this as a bug, though it's not one about the arg
 'taxonomies' but about the content of the returned objects.

 The results of get_post_types() are returning more as expected.

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


More information about the wp-trac mailing list