[wp-trac] [WordPress Trac] #31105: Abstract get_terms() arguments for use in wp_get_object_terms()
WordPress Trac
noreply at wordpress.org
Fri Jan 23 14:37:40 UTC 2015
#31105: Abstract get_terms() arguments for use in wp_get_object_terms()
--------------------------+----------------------------
Reporter: boonebgorges | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Taxonomy | Version:
Severity: normal | Keywords: needs-patch
Focuses: |
--------------------------+----------------------------
While `get_terms()` and `wp_get_object_terms()` have different use cases,
there's a lot of overlap in terms of how one might want to filter results
by the various properties of the matched terms. There's no reason why
`wp_get_object_terms()` shouldn't support many of the term-filtering
arguments of `get_terms()`: exclude, exclude_tree, include, name, slug,
parent, child_of, name__like, description__like, search, hierarchical, and
perhaps others. See #18106, #15675, etc.
Obviously, reproducing all of the argument parsing and SQL generation of
`get_terms()` inside of `wp_get_object_terms()` is not ideal. It'd be nice
of some of this was abstracted out - into a helper class? I dunno - so
that it could be shared by the two functions, and perhaps elsewhere.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31105>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list