[wp-trac] [WordPress Trac] #28145: wp_terms_checklist() returns all non-hierarchical terms even with $descendants_and_self parameter

WordPress Trac noreply at wordpress.org
Sun Dec 6 16:21:23 UTC 2015


#28145: wp_terms_checklist() returns all non-hierarchical terms even with
$descendants_and_self parameter
-------------------------------+------------------------------
 Reporter:  helgatheviking     |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  3.9
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:
-------------------------------+------------------------------

Comment (by boonebgorges):

 Thanks @MikeHansenMe. Can we please move the fixture setup outside of
 `setUp()`? Putting it there adds lots of overhead for every test method in
 the class. It's fine to repeat it in both of the new tests. Also, we
 should be using `self::factory()->term->create()` instead of
 `wp_insert_term()` when setting up test fixtures.

 Regarding the patch, the logic is somewhat convoluted. If the taxonomy is
 non-hierarchical, there's no point in doing the `array_unshift()` stuff at
 all - `$categories` should just be `array( $term )`. Can we simplify a
 bit?

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


More information about the wp-trac mailing list