Creating Custom Taxonomies
This guide explains how to create custom taxonomies in QuickBuildWP.
1. Creating a Custom Taxonomy
To create a custom taxonomy, follow these steps:- Navigate to: WordPress Admin Dashboard → QuickBuildWP → Field Groups.
- Add New Field: Click Add New Field in the desired Field Group.
- Set Field Type: Choose Dropdown or TREE as the field type.
- Use the Options Field: Add taxonomy-related settings in JSON format.
2. JSON Configuration for Custom Taxonomies
Define taxonomies using the following JSON format in the Options Field:{
"options": [
{
"name": "taxonomy",
"value": "TAXONOMY NAME",
"display_name": "TAXONOMY DISPLAY NAME",
"hierarchical": 1,
"native": 1
}
]
}
3. JSON Field Descriptions
| Field | Description |
|---|---|
name |
Set to taxonomy to register a new taxonomy. |
value |
The internal name of the taxonomy. Example: If the Field Group name is listing, the taxonomy is stored as qb_listing_category. The prefix qb_ is hardcoded in the plugin. |
display_name |
The display name for identifying the taxonomy. |
hierarchical |
Set to 1 for parent-child relationships. Exclude this key for flat taxonomies. |
native |
Set to 1 to use WordPress's default taxonomy display. When hierarchical is 1, a tree-like structure is displayed. If not, the system will use a tag-like meta box for value selection. |
4. Example Use Case: Registering a Category Taxonomy
To create a Categories taxonomy with a parent-child structure, use the following JSON in the Options Field:{
"options": [
{
"name": "taxonomy",
"value": "category",
"display_name": "Categories",
"hierarchical": 1,
"native": 1
}
]
}
- This creates a hierarchical taxonomy named Categories, allowing parent-child relationships.
5. Displaying Taxonomies
- If Hierarchical is set to
1, the taxonomy is displayed as a Tree Structure. - If Hierarchical is not set, the taxonomy is displayed as a Tag-like Meta Box, where users can type values directly.