-
Notifications
You must be signed in to change notification settings - Fork 9
TaxonomyRelationshipControl

This component is used to select related taxonomies in a block. It inherits BaseControl.
import { TaxonomyRelationshipControl } = gumponents.components;
<TaxonomyRelationshipControl
label="Select people roles"
taxonomies="people_roles"
value={ taxonomy.map( tax => tax.term_id ) }
onSelect={ taxonomy => setAttributes( { taxonomy } ) }
buttonLabel="Select People Roles"
filter="people_meta"
max="1"
/>The label for the control.
- Type:
String - Required: No
The help text for the control.
- Type:
String - Required: No
Taxonomies to query for.
- Type:
String|Array - Required: No
The label for the select button.
- Type:
String - Required: No
The selected taxonomy IDs for this control.
- Type:
Array - Required: Yes
A function that receives the values of the control.
- Type:
Function - Required: Yes
Creates a custom filter name which can be used to further customize results. More below.
- Type:
String - Required: No
The maximum number of selections that can be made with this control.
- Type:
Number - Required: No
This filter is used to query the get_terms args before they are executed for this control.
If the filter property is used, then that gets appended to this, to create a custom filter name. For example if the value of the filter property was people_meta, the available filter would be gumponents_taxonomies_relationship_query_people_meta
This filter is used to customize results before they are passed on to this control.
If the filter property is used, then that gets appended to this, to create a custom filter name. For example if the value of the filter property was people_meta, the available filter would be gumponents_taxonomies_relationship_results_people_meta