函数原型
get_the_archive_description(): string
函数描述
Retrieves the description for an author, post type, or term archive.
是否弃用
未弃用
函数参数
无
函数返回值
string Archive description.
函数位置
File: wp-includes/general-template.php.
函数源码
function get_the_archive_description() {
if ( is_author() ) {
$description = get_the_author_meta( 'description' );
} elseif ( is_post_type_archive() ) {
$description = get_the_post_type_description();
} else {
$description = term_description();
}
/**
* Filters the archive description.
*
* @since 4.1.0
*
* @param string $description Archive description to be displayed.
*/
return apply_filters( 'get_the_archive_description', $description );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.9.0 | Added support for post type archives. |
| 4.7.0 | Added support for author archives. |
| 4.1.0 | Introduced. |

