get_the_tags( int $id )
Retrieve the tags for a post.
Parameters
- $id
-
(int) (Required) Post ID.
Return
(array|false|WP_Error) Array of tag objects on success, false 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 |
---|---|
WP-2.3.0 | Introduced. |