wp_category_checklist()
wp_category_checklist(
mixed $post_id = 0,
mixed $descendants_and_self = 0,
mixed $selected_cats = false,
mixed $popular_cats = false,
mixed $walker = null,
mixed $checked_ontop = true
) Outputs an unordered list of checkbox input elements labeled with category names.
Parameters 6 required
| Name / Type | Description |
|---|---|
| int | $post_id Optional. Post to generate a categories checklist for. Default 0. $selected_cats must not be an array. Default 0. Required |
| int | $descendants_and_self Optional. ID of the category to output along with its descendants. Default 0. Required |
| (int[] | | false) $selected_cats Optional. Array of category IDs to mark as checked. Default false. Required |
| mixed | (int[] | false) $popular_cats Optional. Array of category IDs to receive the "popular-category" class. Default false. Required |
| Walker | $walker Optional. Walker object to use to build the output. Default is a Walker_Category_Checklist instance. Required |
| bool | $checked_ontop Optional. Whether to move checked items out of the hierarchy and to the top of the list. Default true. Required |