get_the_tags( int|WP_Post $post )
Retrieves the tags for a post.
Parameters
- $post
-
(Required) Post ID or object.
Return
(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.
Source
File: wp-includes/category-template.php
function get_the_tags( $id = 0 ) {
/**
* Filters the array of tags for the given post.
*
* @since WP-2.3.0
*
* @see get_the_terms()
*
* @param array $terms An array of tags for the given post.
*/
return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) );
}
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |