[wp-trac] [WordPress Trac] #44969: Add support to limit results in get_objects_in_term()

WordPress Trac noreply at wordpress.org
Thu Sep 20 02:43:36 UTC 2018


#44969: Add support to limit results in get_objects_in_term()
-----------------------------+-----------------------------
 Reporter:  johnjamesjacoby  |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Taxonomy         |    Version:
 Severity:  normal           |   Keywords:  2nd-opinion
  Focuses:                   |
-----------------------------+-----------------------------
 The `get_objects_in_term()` function currently returns all object IDs
 related to a term in a taxonomy. On sites with many term relationships,
 this may result in tens of thousands of them.

 Without a way to limit the results, developers currently need to write
 their own custom database query just to inject their own `LIMIT` clause.

 Conveniently, the `get_objects_in_term()` function already has a third
 `$args` parameter that's currently only used to pass in a sort-order of
 `ASC` or `DESC`, so adding support for other query clauses is technically
 straight forward.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44969>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list