当サイト、Codex 日本語版は今後積極的な更新は行わない予定です。後継となる新ユーザーマニュアルは、https://ja.wordpress.org/support/ にあります。
万が一、当サイトで重大な問題を発見した際などは、フォーラムや WordSlack #docs チャンネルでお知らせください。</p>
万が一、当サイトで重大な問題を発見した際などは、フォーラムや WordSlack #docs チャンネルでお知らせください。</p>
関数リファレンス/get the category by ID
提供: WordPress Codex 日本語版
< 関数リファレンス
カテゴリー ID からカテゴリー名を取得します。
使い方
<?php get_the_category_by_ID( $cat_ID ); ?>
パラメータ
- $cat_ID
- (整数) (必須) カテゴリー ID
- 初期値: なし
戻り値
- (文字列)
- カテゴリー名。cat_ID が存在しなければ WP_Error を返す。詳しくは is_wp_error() を参照。
変更履歴
バージョン 0.71 にて導入されました。
ソースファイル
get_the_category_by_ID() は wp-includes/category-template.php
にあります。
関連項目
カテゴリータグ:
the_category(),
the_category_rss(),
single_cat_title(),
category_description(),
wp_dropdown_categories(),
wp_list_categories(),
get_the_category(),
get_the_category_by_ID(),
get_category_by_slug(),
get_the_category_list(),
get_category_parents(),
get_category_link(),
is_category(),
in_category()
関数リファレンス、テンプレートタグ目次もご覧ください。
最新英語版: WordPress Codex » Function Reference/get_the_category_by_ID (最新版との差分)