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: 這個函式檢索當前檔案頁(類別、標籤等)的描述。它不接受任何引數,並以字串形式返回描述。

檢索作者、文章型別或術語存檔的描述。

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
檢視更多 >