Use the Taxonomy Form Element to Display any Taxonomy like Categories or Tags form any Post Type
WordPress use taxonomies to save categories, tags or any therm. Nearly every custom post type comes with its own taxonomies.
We know this concept can be very difficult if you get in contact with it at the first time, but after understanding the concept it becomes very easy and logical. Please read the following articles if you do not know exactly what custom post types and taxonomies are used for in WordPress.
With the Taxonomy Form Element you Can Create a Select Box (DropDown) of any Taxonomy.
One post type can have many taxonomies. You will often use many taxonomy form elements in one form.
Normal WordPress Posts
- category -> Post Categories
- post_tag -> Post Tags
- post_format -> Post Formats
- product_cat -> Post Categories
- product_tag -> Post Tags
- product_taype -> Post Formats
- ... -> Can be more taxonomies if WooCommerce plugins extend WooCommerce with there own taxonomy.
- Every product attribute is stored as taxonomy and gets a prefix pa_if you create an attribute "Size" the taxonomy will be pa_size
Use the Taxonomy Form Element
Select the taxonomy form element from the right sidebar form elements. This will add a new form element taxonomy to your form. In the form element options select the taxonomy this form element is used for. You can also define a default term.
Allow the user to create new therms
To allow creating new therms check the box "user can create new".
If you want to allow multiple selection, check the Multiple
You can also set the field to required and add a validation message.
You can set the field to hidden. This can be useful if you want to create a form for fixed categories. If you select a default and set the taxonomy to hidden the post will always get saved in the default therm.
There are more options added all the time. If you miss a filter or option, let us know and we will add it if possible ;)