[wp-trac] [WordPress Trac] #30833: Post type object does not always have taxonomies populated correctly.

WordPress Trac noreply at wordpress.org
Tue Dec 23 21:53:24 UTC 2014


#30833: Post type object does not always have taxonomies populated correctly.
--------------------------+-----------------------------
 Reporter:  desrosj       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Using {{{get_post_type_object()}}}, I found that the {{{'taxonomies'}}}
 array was not always accurate with all added taxonomies.

 For example, if you do the following, {{{get_post_type_object( 'post'
 )}}}, there should be {{{'category'}}}, {{{'post_tag'}}}, and
 {{{'post_format'}}} values (on a fresh install of WordPress) in that
 array.

 The only time taxonomies seem to make it into there is when you define
 taxonomies in the {{{'taxonomies'}}} argument when using
 {{{register_post_type()}}}.

 The attached patch fixes this issue. However, some additional thought may
 need to be given. Was this post type object property meant to be used like
 that? Do we only populate it with public taxonomies? Do we add a parameter
 to {{{register_taxonomy()}}} to control if it gets listed there?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30833>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list