Field type
relationship
Multi-select post relationship. Today this is a thin alias over post-object with multiple: true forced on — same picker, same stored shape.
Type: relationship · Stored attribute type: array
Stored value
number[] (default) OR post-object[] when returnFormat: "object" is set
Supports
- Multi-select with drag-to-reorder
- All
post-objectfeatures (post type filter, taxonomy filter, return format, etc.)
Config options
| Option | Type | Default | Description |
|---|---|---|---|
postType | string | string[] | WP post type slug(s) to search. | |
returnFormat | string | "id" (default) stores post IDs; "object" stores full post objects. | |
enablePostTypeFilter | boolean | false | Show a post-type dropdown in the picker (when multiple types are allowed). |
enableTaxonomyFilter | boolean | false | Show taxonomy term dropdowns in the picker. |
filterTaxonomies | { slug, label }[] | Taxonomies to surface as filters. |
Gotchas
- Functionally identical to
post-objectwithmultiple: true. Pick whichever name reads better in yourblock.fields.json.
Example
{ "id": "ctrl_related",
"type": "relationship",
"label": "Related projects",
"attributeKey": "related",
"postType": "project",
"parentPanelId": "panel" }Every field also takes the keys common to all fields.