get_tag_link()
get_tag_link( int|object $tag ) 检索到标记的链接。Retrieve the l…
get_tag_link( int|object $tag )
检索到标记的链接。
Retrieve the link to the tag.
检索到标记的链接。
Retrieve the link to the tag.
目录锚点:#说明#参数#返回#源码
说明(Description)
另见函数 get_term_link()
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $tag | (int | object) | 必需 | 标记ID或对象。 |
返回(Return)
(string)链接成功,如果标记不存在,则为空string。
源码(Source)
/**
* Retrieve the link to the tag.
*
* @since 2.3.0
* @see get_term_link()
*
* @param int|object $tag Tag ID or object.
* @return string Link on success, empty string if tag does not exist.
*/
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;
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.3.0 | wp-includes/category-template.php:1119 | 1 function | 1 function |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!