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

WordPress Trac noreply at wordpress.org
Sat Jul 1 13:08:52 UTC 2017


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

Comment (by boonebgorges):

 @GhostToast - Thanks for reporting this. I'm unable to reproduce, though
 it's likely that I'm not understanding the setup correctly. Here's the
 automated test I was using to try reproducing:

 {{{
                 register_post_type( 'wptests_pt' );
                 register_taxonomy( 'wptests_tax2', 'wptests_pt', array(
                         'args' => array(
                                 'orderby' => 'term_order',
                         ),
                 ) );

                 $p = self::factory()->post->create( array(
                         'post_type' => 'wptests_pt',
                 ) );

                 $t = self::factory()->term->create( array(
                         'taxonomy' => 'wptests_tax2',
                 ) );

                 wp_set_object_terms( $p, $t, 'wptests_tax2' );

                 $found = get_the_terms( $p, 'wptests_tax2' );
                 print_r( $found );
 }}}

 If you're still having the issue, could you please open a new ticket that
 references this one, and contains more detailed instructions (ideally,
 with some code examples) to reproduce the issue? The current ticket was
 closed against 4.7.5, so it'd be nice to start fresh. Thanks!

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


More information about the wp-trac mailing list