Skip to content

repeater

Simone Montali edited this page Sep 9, 2019 · 2 revisions

Repeater

{
  "id": "repeater",
  "type": "repeater",
  "size": "half",
  "label": "Repeater",
  "description": "Description",
  "min": 4,
  "max": 10,
  "fields": [
    {
      "id": "text1",
      "type": "text",
      "size": "half",
      "label": "label",
      "description": "description",
      "placeholder": "placeholder",
      "required": true
    },
    {
      "id": "text2",
      "type": "text",
      "size": "half",
      "label": "label",
      "description": "description",
      "placeholder": "placeholder",
      "required": true
    }
  ]
},

The repeater field allows you to repeat a field multiple times; the user is able to change the number of repetitions between a min and a max.

Options

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

Custom options

The repeater field has several additional options:

  • "min" defines the minimum number of fields for the repeater. Note that if the fields have not been set, the minimum number will be shown when editing posts.

  • "max" defines the maximum number of fields for the repeater. The UI will warn the user when this limit is reached.

  • "fields" is an array containing the fields for each repetition. To know more about the available fields, check the field's getting started page.

Filters

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

Clone this wiki locally