wp_terms_checklist

Sponsored Link

wp_category_checklist()のタクソノミーの独自のバージョン

Sponsored Link

Taxonomy independent version of wp_category_checklist()

wp_terms_checklistのファンクションタグ使用方法

<?php wp_terms_checklist( $post_id, $args ); ?>

デフォルトの使用方法

$post_id

(int) (optional)
Default: 0

$args

(array) (optional)
Default: array()

<?php $args = array(
	'descendants_and_self'  => 0,
	'selected_cats'         => false,
	'popular_cats'          => false,
	'walker'                => null,
	'taxonomy'              => 'category',
	'checked_ontop'         => true
); ?>

wp_terms_checklistのパラメーター

descendants_and_self

(boolean) この投稿とそれらの子、或いは全てのカテゴリーを表示するために適用するカテゴリーのみ表示します。デフォルトはfalse(全てのカテゴリーを表示する)。有効な値:

(boolean) Display only categories that apply to this post and their children or display all categories. The default is false (display all categories). Valid values:

  • 1 (True)
  • 0 (False) – Default

selected_cats

(array) デフォルトは’false’で、デフォルトでカテゴリーが選択されません。しかし、$post_idが提供している場合は、カテゴリーが既に$post_idがデフォルトで選択するために適用されています。それ以外の場合は、カテゴリーIDの配列がリストにデフォルトで選択されているカテゴリーを指定します。

(array) Default is ‘false’, no categories selected by default. However, if $post_id is provided, categories already applied to $post_id are selected by default. Otherwise, an array of category ids specify which categories should be selected by default in the list.

popular_cats

(array) デフォルト値は ‘false’です。カウントで上位10カテゴリーが表示されます。それ以外の場合は、カテゴリーの配列は、人気のカテゴリーリストに表示されるべきカテゴリを指定します。

(array) Default is ‘false’. Shows top 10 categories by count. Otherwise, an array of categories specify which categories should be shown in the popular categories list.

walker

(object) Walkerクラスが持つリストをレンダリングします。有効な値:

(object) Walker class to render the list with. Valid values:

  • object – Walker_CategoryまたはWalkerのいずれかを拡張するクラスのインスタンス
  • object – an instance of a class that extends either Walker_Category or Walker

taxonomy

(string) タクソノミーを返します。このパラメータはバージョン3.0で追加されました。有効な値:

(string) Taxonomy to return. This parameter added at Version 3.0. Valid values:

  • category – default
  • taxonomy – or any registered taxonomy

checked_ontop

(boolean)タームリストまたはリストでない上部にカテゴリーをチェックして表示します。デフォルトはtrue(タームリストの上部にカテゴリーをチェックして表示)。有効な値:

(boolean) Display checked categories at the top of the terms list or not. The default is true (display checked categories at the top of the terms list). Valid values:

  • 1 (True) – Default
  • 0 (False)

変更ログ

Since: 3.0

ソースファイル

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

wp_terms_checklist() is located in wp-admin/includes/template.php

Sponsored Link