Advertisements

get_tag_link

Definition:
function get_tag_link( $tag ) {}

Retrieve the link to the tag.

Parameters

  • 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;

}

1725

Advertisements

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:

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: