tag_description()
云策文档标注
概述
tag_description() 函数用于检索标签的描述信息,基于 term_description() 实现,输出时会自动包裹在 <p> 标签中。
关键要点
- 参数 $tag 可选,指定标签 ID,默认为当前标签 ID
- 返回值为字符串类型的标签描述,若不存在则返回空
- 输出内容会自动包含在 <p> 标签内
- 函数内部调用 term_description() 实现功能
代码示例
$description = tag_description();注意事项
确保标签 ID 有效,否则可能返回空字符串。
原文内容
Retrieves tag description.
Parameters
$tagintoptional-
Tag ID. Defaults to the current tag ID.
Source
function tag_description( $tag = 0 ) {
return term_description( $tag );
}
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
Skip to note 2 content
Codex
Basic Example
Displays a description of the tag id 28.