[wp-trac] [WordPress Trac] #19094: Add wp_get_object_terms filters.
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 1 13:54:19 UTC 2011
#19094: Add wp_get_object_terms filters.
-----------------------------------+-----------------------------
Reporter: Zatsugami | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Taxonomy | Version: 3.2.1
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion |
-----------------------------------+-----------------------------
Comment (by Zatsugami):
In my case I needed to join mysql table, so probably there is no other way
to do it.
There is posts_clauses, terms_clauses (as I mentioned, it is not called
when getting objects terms), but there is no object_terms_clauses or any
other filters.
I could use filter 'wp_get_object_terms' which is called at the end of
this function, but what you get there is an array of terms, so I would
need to loop through them, get the ids of terms and do other query.
Anyway, so much unnecessary work would be done.
Also, there would be a small inconsistency in this patch in regards to
pieces names in object_terms_clauses array. The 'select' piece in other
filters is called 'fields';
But there would be more work to do with the code to make the names the
same. But this can be done if you prefer consistency.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19094#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list