Relation Input
Enables to reference items through a WP-JSON endpoint.
js
{
input: {
type: 'relation',
restBase: 'slider'
}
}WARNING
Post types and taxonomies must be exposed in the REST API to be available in the relation input. Read this cookbook recipe to learn how.
TIP
If you want to reference posts or terms, you probably want to use the post and term input types instead.
Input Options
| Option | Values | Default | Description |
|---|---|---|---|
restBase | string | - | Rest base (/wp-json/wp/v2/<restBase>) can be post type or taxonomy. Use categories for the default post categories. |
placeholder | string | 'Element suchen' | Text displayed as search input placeholder. |
multiple | boolean | false | Whether multiple items can be selected. |
allowDuplicates | boolean | true | Whether duplicate items can be added if multiple is true. |
editLink | string | boolean | true | Declare edit link for individual items, %s will be replaced with its post ID. If set to false, edit links will be disabled. If set to true, a default edit link will be determined automatically. |
Conditions
The relation input type supports the following conditions for dynamic visibility:
| Condition | Payload | Description |
|---|---|---|
isEmpty | booleandefaults to true | Checks whether an item has been selected or not. |