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:
  • 4: .

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.

Related Functions

clean_object_term_cache, update_object_term_cache, get_objects_in_term, wp_get_object_terms, wp_set_object_terms

Top Google Results

User discussions

wpseek mobile