[wp-trac] [WordPress Trac] #33565: Add option to pass an array of objects or IDs to $current_category in wp_list_categories()

WordPress Trac noreply at wordpress.org
Thu Aug 27 02:28:24 UTC 2015


#33565: Add option to pass an array of objects or IDs to $current_category in
wp_list_categories()
-------------------------------------+---------------------------
 Reporter:  vilkatis                 |       Owner:  boonebgorges
     Type:  enhancement              |      Status:  reopened
 Priority:  normal                   |   Milestone:  4.4
Component:  Taxonomy                 |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------------
Changes (by boonebgorges):

 * milestone:  Awaiting Review => 4.4


Comment:

 Replying to [comment:3 vilkatis]:
 > I added two unit tests that I could think of , don't know if that's
 enough or if I did them right.
 >
 > I used it for some clients who had products belonging to a couple of
 categories at the same time , as they wanted all relevant categories to be
 highlighted in a sidebar menu.

 Thanks, this seems sensible.

 Looking at it more closely, I don't think that it's a great idea for us to
 start accepting term objects in addition to term IDs. There aren't many
 places where we do this for terms (at least not that I can think of). When
 and if we have a proper `WP_Term` object, perhaps we can start thinking of
 retrofitting functions to accept it.

 I've simplified the patch and the unit tests in [attachment:33565.2.diff].

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


More information about the wp-trac mailing list