[wp-trac] [WordPress Trac] #40496: get_the_terms() doesn't respect register_taxonomy()'s 'orderby' => 'term_order'

WordPress Trac noreply at wordpress.org
Fri Apr 21 18:28:43 UTC 2017

#40496: get_the_terms() doesn't respect register_taxonomy()'s 'orderby' =>
 Reporter:  danielbachhuber          |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.7.5
Component:  Taxonomy                 |     Version:  4.7
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:

Comment (by danielbachhuber):

 40496.2.diff includes the unit test for querying two taxonomies, and fixes
 the unit test by:

 1. Parsing `$args` and setting a default `$terms = array();` before
 taxonomy args are processed.
 2. Merging `$terms = array_merge( $terms, get_terms( $args ) );` after
 taxonomy args are processed, to ensure already queried terms aren't

Ticket URL: <https://core.trac.wordpress.org/ticket/40496#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list