---
agentTools:
  projectIndex: https://olympus.readme.io/llms.txt
---

# Multiselect

[block:code]
{
  "codes": [
    {
      "code": "<?php\n\n$tea_content = array(\n    array(\n        'type' => 'multiselect',\n        'title' => 'Select the Minions that you may know',\n        'id' => 'my_multiselect_field_id',\n        'default' => 'henry',\n        'description' => 'Pay attention to this question ;)',\n        'options' => array(\n            'henry' => 'Henry',\n            'jacques' => 'Jacques',\n            'kevin' => 'Kevin',\n            'tom' => 'Tom',\n        ),\n    ),\n);",
      "language": "php"
    }
  ]
}
[/block]

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/LRhXNt9EQpnKIcDw2KAq_multiselect-1.png",
        "multiselect-1.png",
        "1233",
        "156",
        "#935952",
        ""
      ]
    }
  ]
}
[/block]

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/XoHHA6VfRrGAkQMs55JY_multiselect-2.png",
        "multiselect-2.png",
        "1234",
        "191",
        "#496a6e",
        ""
      ]
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "Retrieve data"
}
[/block]

Using the `_get_option('my_multiselect_field_id')` method, you'll get (with a `json_encode()` display):

[block:code]
{
  "codes": [
    {
      "code": "[\"henry\", \"jacques\", \"kevin\", \"tom\"]",
      "language": "json"
    }
  ]
}
[/block]