WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp terms checklist

Contents

Description

Taxonomy independent version of wp_category_checklist()

Usage

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

Default Usage

$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
); ?>

Parameters

descendants_and_self 
(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) 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) 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 class to render the list with. Valid values:
  • object - an instance of a class that extends either Walker_Category or Walker
taxonomy 
(string) Taxonomy to return. This parameter added at Version 3.0. Valid values:
  • category - default
  • taxonomy - or any registered taxonomy
checked_ontop 
(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)

Change Log

Since: 3.0

Source File

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