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

# Background

[block:code]
{
  "codes": [
    {
      "code": "<?php\n\n$tea_content = array(\n    array(\n        'type' => 'background',\n        'title' => 'A new paint :D',\n        'id' => 'my_background_field_id',\n        'default' => array(\n            'image' => 'my_default_background_url',\n            'image_custom' => 'my_custom_default_background_url',\n            'color' => '#ffffff',\n            'repeat' => 'no-repeat',\n            'position' => array(\n                'x' => 'left',\n                'y' => 'top',\n            ),\n        ),\n        'description' => \"It's tricky :)\",\n        'backgrounds' => true,\n    ),\n);",
      "language": "php"
    }
  ]
}
[/block]

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/LLrb4GfIQzik5CwUGikW_background.png",
        "background.png",
        "1227",
        "596",
        "#3a5565",
        ""
      ]
    }
  ]
}
[/block]

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

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

[block:code]
{
  "codes": [
    {
      "code": "{\n    \"image\": \"http:\\/\\/your_complete_url\\/wp-content\\/themes\\/your_theme\\/vendor\\/takeatea\\/tea-theme-options\\/src\\/Fields\\/Background\\/img\\/linen.png\",\n    \"image_custom\": \"http:\\/\\/your_complete_url\\/wp-content\\/themes\\/your_theme\\/img\\/teato-tiny.svg\",\n    \"color\": \"#ffffff\",\n    \"repeat\": \"no-repeat\",\n    \"position_x\": \"left\",\n    \"position_y\": \"top\"\n}",
      "language": "json"
    }
  ]
}
[/block]