term_description

Sponsored Link

最初は、WordPressバージョン2.8で利用可能になりました。このテンプレートタグは、指定された用語の説明を返します。用語IDと分類は、パラメータのとおりです。単語IDが渡されていない場合は、説明は、現在の用語(例えば投稿カテゴリーやタグ)を照会し返すでしょう。

Sponsored Link

First available with WordPress Version 2.8, this template tag returns the description of a given term. A term ID and taxonomy are as parameters. If no term ID is passed, the description current queried term (e.g. post category or tag) will be returned.

term_descriptionのテンプレートタグ使用方法

<?php term_description( $termID, $taxonomy ) ?>

term_descriptionのパラメーター

termID

説明を返すための用語IDです。

(string) (Optional) The ID of the term to return a description.

デフォルト:現在のクエリー用語のIDです。

Default: ID of current query term

taxonomy

  • ‘category’
  • ‘post_tag’
  • ‘link_category’

Default: post_tag

戻り値

(string)

用語の説明です。

Description of term.

デフォルトの使用は、現在のクエリー用語の説明を返します。

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

<?php $term_descr = term_description(); ?>

投稿タグID28の説明を表示する方法

<?php echo 'Term Description: ' . term_description('28','post_tag'); ?>

変更ログ

  • Since: 2.8.0

ソースファイル

term_description()は、wp-includes/category-template.php内に位置しています。

term_description() is located in wp-includes/category-template.php.

Sponsored Link