GCBGutenberg
Control Blocks
Buy

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-object features (post type filter, taxonomy filter, return format, etc.)

Config options

OptionTypeDefaultDescription
postTypestring | string[]WP post type slug(s) to search.
returnFormatstring"id" (default) stores post IDs; "object" stores full post objects.
enablePostTypeFilterbooleanfalseShow a post-type dropdown in the picker (when multiple types are allowed).
enableTaxonomyFilterbooleanfalseShow taxonomy term dropdowns in the picker.
filterTaxonomies{ slug, label }[]Taxonomies to surface as filters.

Gotchas

  • Functionally identical to post-object with multiple: true. Pick whichever name reads better in your block.fields.json.

Example

JSON
{ "id": "ctrl_related",
  "type": "relationship",
  "label": "Related projects",
  "attributeKey": "related",
  "postType": "project",
  "parentPanelId": "panel" }

Every field also takes the keys common to all fields.

Built from GCB Lite 0.4.0 (ce232d4). Source: schemas/controls/relationship.md.

Copyright © 2026 Runchain. WordPress is a trademark of the WordPress Foundation.