# Editor (WYSIWYG)

Editor field renders a WYSIWYG editor. Due to complexities of the field, it does not have the switch between Text and Visual modes.

## Example configuration

```php
...
array(
    'title' => 'My editor field title',
    'id' => 'editor-option',
    'desc' => 'Short description for the field',
    'tab' => 'main',
    'type' => 'editor',
),
...
```

This will produce something similar to the following

![](/files/-LKMTpT4_RVZq41TQghR)

In other words it will look like a WYSIWYG editor from the post page.

## Filters

The field uses [`wp_kses`](https://developer.wordpress.org/reference/functions/wp_kses/) to sanitize the value before storing it in the database. The following filters can be used to control it.

| Name                                                                         | Description                                         |
| ---------------------------------------------------------------------------- | --------------------------------------------------- |
| [`alch_allowed_editor_html_tags`](/filters/alch_allowed_editor_html_tags.md) | Can be used to control which HTML tags are allowed. |
| [`alch_allowed_editor_protocols`](/filters/alch_allowed_editor_protocols.md) | Can be used to control which protocols are allowed. |

See the filters page for more details.

## Params

| Name    | Type   | Description                                                      |
| ------- | ------ | ---------------------------------------------------------------- |
| `type`  | string | `editor` **(required)**                                          |
| `id`    | string | Unique ID that will be used to retrieve the value **(required)** |
| `tab`   | string | Specifies in which tab this option will be rendered              |
| `title` | string | Shows a heading to the left of the field                         |
| `desc`  | string | Shows a description text (can have HTML)                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alchemy-options.com/fields/editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
