WordPress at a glance

get_the_tags() WP 1.0

Retrieve the tags for a post.

Works based on: get_the_terms()
Hooks in function

Array/false/WP_Error. Array of tag objects on success, false on failure.


get_the_tags( $id );
Post ID.
Default: 0

Code of get the tags: wp-includes/category-template.php VER 5.1.1

function get_the_tags( $id = 0 ) {

	 * Filters the array of tags for the given post.
	 * @since 2.3.0
	 * @see get_the_terms()
	 * @param WP_Term[] $terms An array of tags for the given post.
	return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) );

Related Functions

From tag: WP Loop

More from category: For posts

No comments
    Hello, !     Log In . Register