Core Function
View Source on Trac ↗ get_object_term_cache()
get_object_term_cache( mixed $id, mixed $taxonomy ) Retrieves the cached term objects for the given object ID.
Parameters 2 required
| Name / Type | Description |
|---|---|
| $id int | Term object ID, for example a post, comment, or user ID. Required |
| $taxonomy string | Taxonomy name. Required |
Return Value
((bool)
(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.
Function Information
Since Version
2.3.0
Source File
wp-includes/taxonomy.php
Advertisement