get_the_tags( int $id )

Retrieve the tags for a post.


Description


Parameters

$id

(int) (Required) Post ID.


Top ↑

Return

(array|false|WP_Error) Array of tag objects on success, false on failure.


Top ↑

Source

File: wp-includes/category-template.php

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' ) );
}

Top ↑

Changelog

Version Description
2.3.0 Introduced.