A WordPress-centric search engine for devs and theme authors



get_the_tags ›

Since2.3.0
Deprecatedn/a
get_the_tags ( $id = 0 )
Parameters:
  • (int) $id Post ID.
    Required: No
    Default:
Returns:
  • (array|false|WP_Error) Array of tag objects on success, false on failure.
Defined at:
Codex:

Retrieve the tags for a post.



Source

function get_the_tags( $id = 0 ) {

	/**
	 * Filters the array of tags for the given post.
	 *
	 * @since 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' ) );
}