Summery Summery

Output an unordered list of checkbox input elements labeled with category names.

Syntax Syntax

wp_category_checklist( int $post_id, int $descendants_and_self, int[] $selected_cats = false, int[] $popular_cats = false, Walker $walker = null, bool $checked_ontop = true )

Parameters Parameters


(int) (Optional) Post to generate a categories checklist for. Default 0. $selected_cats must not be an array. Default 0.


(int) (Optional) ID of the category to output along with its descendants. Default 0.


(int[]) (Optional) Array of category IDs to mark as checked.

Default value: false


(int[]) (Optional) Array of category IDs to receive the "popular-category" class.

Default value: false


(Walker) (Optional) Walker object to use to build the output. Default is a Walker_Category_Checklist instance.

Default value: null


(bool) (Optional) Whether to move checked items out of the hierarchy and to the top of the list.

Default value: true

Source Source

File: wp-admin/includes/template.php

function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
			'taxonomy'             => 'category',
			'descendants_and_self' => $descendants_and_self,
			'selected_cats'        => $selected_cats,
			'popular_cats'         => $popular_cats,
			'walker'               => $walker,
			'checked_ontop'        => $checked_ontop,


Changelog Changelog

Version Description
2.5.1 Introduced.

See also See also


Leave a Reply