nested

Type: boolean
Possible values: true, false

Available since version 1.3

In WordPress some taxonomies are defined as “hierarchical”, meaning that terms can be nested beneath other terms. This allows for parent/child relationships among terms. Post categories are the most common example of this.

Often it is desirable to display terms hierarchically in your search form so that users can see which terms are parents or children of other terms. To do this, simply set the ‘nested’ option to true. The result will look something like this:

The ‘nested’ parameter is only supported for the ‘taxonomy’ field type, and only works with select, multi-select, checkbox, and radio formats.

In select fields the nesting will be shown using dashes ‘-‘, while checkboxes and radio buttons will be displayed using nested < ul > groups.

NOTE: This feature only works if you do not supply a custom ‘values’ array for the field, i.e. you must show all terms by default. But you can still use the ‘exclude’ option to hide certain terms if you need to. *Excluding a term from the list will exclude that term AND all of its children when nesting is enabled.*

Fields that use this parameter