Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp terms checklist


Taxonomy independent version of wp_category_checklist()


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

Default Usage

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


(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
(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.
(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.
(object) Walker class to render the list with. Valid values:
  • object - an instance of a class that extends one of Walker_Category or Walker

Note: Defaults to Walker_Category_Checklist, which is located in wp-admin/includes/template.php. However this class may not be defined when wp_terms_checklist is called, so you should be careful if you wish to extend this class.

(string) Taxonomy to return. This parameter added at Version 3.0. Valid values:
  • category - default
  • taxonomy - or any registered taxonomy
(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