[wp-trac] [WordPress Trac] #29859: get_terms on hierarchical taxonomy fails when 'fields' arg contains 'id=>name' OR 'id=>slug'

WordPress Trac noreply at wordpress.org
Mon Oct 6 22:04:13 UTC 2014


#29859: get_terms on hierarchical taxonomy fails when 'fields' arg contains
'id=>name' OR 'id=>slug'
--------------------------------------+---------------------------
 Reporter:  technical_mastermind      |       Owner:  boonebgorges
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  4.1
Component:  Taxonomy                  |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+---------------------------
Changes (by boonebgorges):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"29845"]:
 {{{
 #!CommitTicketReference repository="" revision="29845"
 In get_terms(), select term taxonomy count for all values of 'fields'.

 Not having the count caused queries with 'fields' values of 'id=>name' and
 'id=>slug' to return incorrect results when querying a hierarchical
 taxonomy
 with 'hide_empty=true'.

 Includes unit tests for get_terms() when using various combinations of
 'fields',
 'hide_empty', and 'hierarchical' arguments.

 Props technical_mastermind.
 Fixes #29859.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29859#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list