get_the_archive_description

函数
get_the_archive_description ( No parameters )
返回值
  • (string) Archive description.
相关
  • term_description()
定义位置
相关方法
the_archive_descriptionget_the_author_descriptionget_file_descriptionget_the_archive_titleget_the_post_type_description
引入
4.1.0
弃用
-

get_the_archive_description: 这个函数检索当前档案页(类别、标签等)的描述。它不接受任何参数,并以字符串形式返回描述。

检索作者、文章类型或术语存档的描述。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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 );
}
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 ); }
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 );
}

常见问题

FAQs
查看更多 >