Opened 6 years ago
Last modified 4 years ago
#44969 new enhancement
Add support to limit results in get_objects_in_term()
Reported by: | johnjamesjacoby | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | 2nd-opinion has-patch has-unit-tests |
Focuses: | Cc: |
Description
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.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Patch to add limit feature to $args for get_objects_in_term; unit tests included.