[wp-trac] [WordPress Trac] #23635: get_objects_in_term - identify matching terms
WordPress Trac
noreply at wordpress.org
Tue Feb 26 21:29:55 UTC 2013
#23635: get_objects_in_term - identify matching terms
-----------------------------+-------------------------
Reporter: leepowers | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Taxonomy
Version: 3.5.1 | Severity: minor
Keywords: needs-patch |
-----------------------------+-------------------------
`get_objects_in_term` is great for viewing taxonomy relationships for non-
posts. However the return value is too limited for certain use cases. For
When fetching object_ids for multiple terms the return value doesn't
inform as to the matching term.
For instance this query:
{{{
#!php
$object_ids = get_objects_in_term(array(55, 66, 77, 88, 99),
"my_custom_taxonomy");
}}}
Might return an array of object_ids as follows:
{{{
#!php
array(101, 202, 303, 404);
}}}
However there's no way to tell '''which''' term a particular object_id
matched. Did object 101 match term 77? Or maybe it was term 99? Or both?
I've created a modified version of `get_objects_in_term` which will
addresses this issue. I'll submit a patch, but am wondering if there's
another way to achieve this functionality.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23635>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list