get_object_term_cache
get_object_term_cache ( $id, $taxonomy )
Parameters:- (int) id Term object ID, for example a post, comment, or user ID.
- (string) taxonomy Taxonomy name.
Returns:- (bool|WP_Term[]|WP_Error) Array of `WP_Term` objects, if cached. False if cache is empty for `$taxonomy` and `$id`. WP_Error if get_term() returns an error object for any term.
Defined at:Change Log: - Introduced in WordPress: 2.3.0
- Deprecated in WordPress: —
Description
Retrieves the cached term objects for the given object ID.Upstream functions (like get_the_terms() and is_object_in_term()) are
responsible for populating the object-term relationship cache. The current
function only fetches relationship data that is already in the cache.