[wp-trac] [WordPress Trac] #23635: get_objects_in_term - identify matching terms

WordPress Trac noreply at wordpress.org
Tue Oct 21 21:20:10 UTC 2014


#23635: get_objects_in_term - identify matching terms
------------------------------------------+-----------------------------
 Reporter:  leepowers                     |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Taxonomy                      |     Version:  3.5.1
 Severity:  minor                         |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------
Changes (by boonebgorges):

 * keywords:  needs-patch => needs-patch needs-unit-tests
 * milestone:  Awaiting Review => Future Release


Comment:

 >  am wondering if there's another way to achieve this functionality.

 Only by looping over each of your terms and calling `get_objects_in_term(
 $term_id )` for each.

 I can imagine supporting something like `$args['format']` that lets you
 specify that you'd like the results returned as an array:

 {{{
 $objects = get_objects_in_term( array( 4, 5 ), 'my_taxonomy', array(
 'format' => 'array' ) );

 /*
 array(
     4 => array( 10, 22, 130 ),
     5 => array( 15, 31 ),
 ),
 */
 }}}

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


More information about the wp-trac mailing list