get_the_terms
get_the_terms ( $post, $taxonomy )
Parameters:- (int|WP_Post) post Post ID or object.
- (string) taxonomy Taxonomy name.
Returns:- (WP_Term[]|false|WP_Error) Array of WP_Term objects on success, false if there are no terms or the post does not exist, WP_Error on failure.
Defined at: - Introduced in WordPress: 2.5.0
- Deprecated in WordPress: —
Description
Retrieves the terms of the taxonomy that are attached to the post.