tag_description()获取当前标签的描述

目录

描述

First available with WordPress Version 2.8, this template tag returns the description of a tag. A tag ID can be passed as a parameter, but if no tag ID is passed, the description current queried tag will be returned.

tag_description() 描述

用法

 <?php tag_description$tag_id ); ?> 

Default Usage

The default usage returns the description of the current queried tag.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
<?php $description = tag_description(); ?>

tag_description() 用法

参数

$tag_id

(integer) (可选) The ID of the tag to return a description.

默认值: Description of current query tag.

tag_description() 参数

返回值

(string

Tag description, available.

tag_description() 返回值

注意

tag_description() 注意

历史

  • 添加于 版本: 2.8.0

tag_description() 历史

源文件

tag_description() 函数的代码位于 wp-includes/category-template.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Retrieve tag description.
 *
 * @since 2.8.0
 *
 * @param int $tag Optional. Tag ID. Will use global tag ID by default.
 * @return string Tag description, available.
 */
function tag_description( $tag = 0 ) {
	return term_description( $tag );
}

tag_description() 源文件

相关