function get_tag_link( $tag ) {}

Retrieve the link to the tag.


  • int|object $tag: Tag ID or object.

Return values

returns:Link on success, empty string if tag does not exist.

Source code

function get_tag_link( $tag ) {

	if ( ! is_object( $tag ) )

		$tag = (int) $tag;

	$tag = get_term_link( $tag, 'post_tag' );

	if ( is_wp_error( $tag ) )

		return '';

	return $tag;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: