Make WordPress Core

Opened 19 months 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
Focuses: Cc:


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.

Change History (0)

Note: See TracTickets for help on using tickets.