Skip to content

relation

simmontali edited this page Sep 24, 2019 · 1 revision

Relation

{
  "type": "relation",
  "id": "input-relation",
  "label" : "input-relation",
  "description": "description",
  "relation": {
    "post_type": "book"
  },
  "size": "half",
  "required": true
}

The relation makes choosing other posts as field possible. Just specify the desired post_type, and the user will get a select field containing the posts.

Options

For the general settings fields, check the getting started page.

Custom options

The relation field has an additional option:

  • "relation" contains the options for the relation. Right now, you can just insert:
    • "post_type" with the desired post type's slug.

Filters

You can filter the field's fetched value by calling WordPress' add_filter with the tag "aeria_get_relation".

Clone this wiki locally