---
title: "tinymce.EditorOptions"
description: "TinyMCE Editor Options API. The options API provides the ability to register, lookup and set editor options."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editoroptions/"
md_url: "https://www.tiny.cloud/docs/tinymce/7/apis/tinymce.editoroptions/index.md"
version: "7"
last_updated: "2024-06-19T10:41:44Z"
tokens: 891
---
Important This page documents TinyMCE 7. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../../latest/apis/tinymce.editoroptions/).
# tinymce.EditorOptions

TinyMCE Editor Options API. The options API provides the ability to register, lookup and set editor options.

All options need to be registered before they can be used in the editor. This is done by using the `register()` API which requires a name and an option specification. The specification should contain a `processor` and an optional `default` value. The processor is used to parse and validate the option value either passed in the initial configuration or via the `set()` API.

The processor can either be a custom function that returns if the option value is valid, or one of the following built-in processors:

- `string`
- `number`
- `boolean`
- `array`
- `function`
- `object`
- `string[]`
- `object[]`
- `regexp`

## Examples

```javascript
// Register an option
editor.options.register('custom_option', {
  processor: 'string',
  default: 'myoption'
});

// Lookup an option
editor.options.get('custom_option');

// Set an option
editor.options.set('custom_option', 'value');
```

## Summary

### Methods

| Name | Summary | Defined by |
| --- | --- | --- |
| [debug()](#debug) | Logs the initial raw editor options to the console. | `EditorOptions` |
| [get()](#get) | Get the value of a registered option. | `EditorOptions` |
| [isRegistered()](#isRegistered) | Check if an option has been registered. | `EditorOptions` |
| [isSet()](#isSet) | Checks to see if a value has been set for the specified option. | `EditorOptions` |
| [register()](#register) | Register a new option that can be used within TinyMCE. | `EditorOptions` |
| [set()](#set) | Set the value for a registered option. | `EditorOptions` |
| [unset()](#unset) | Clear the set value for the specified option and revert back to the default value. | `EditorOptions` |

## Methods

### debug()

```javascript
debug()
```
Logs the initial raw editor options to the console.

### get()

```javascript
get(name: String): Object
```
Get the value of a registered option.

#### Parameters

- `name (String)` - Name of a registered option.

#### Return value

- `Object` - An option value, the registered default if not set, or undefined if not registered.

### isRegistered()

```javascript
isRegistered(name: String): Boolean
```
Check if an option has been registered.

#### Parameters

- `name (String)` - Name of the option.

#### Return value

- `Boolean` - True if the option has already been registered, otherwise false.

### isSet()

```javascript
isSet(name: String): Boolean
```
Checks to see if a value has been set for the specified option.

#### Parameters

- `name (String)` - Name of the option.

#### Return value

- `Boolean` - True if the option has a value set, otherwise false.

### register()

```javascript
register(name: String, spec: OptionSpec)
```
Register a new option that can be used within TinyMCE.

#### Parameters

- `name (String)` - Name of the option.
- `spec (OptionSpec)` - An option spec describing how to validate the option with other optional metadata.

### set()

```javascript
set(name: String): Boolean
```
Set the value for a registered option.

#### Parameters

- `name (String)` - Name of a registered option.

#### Return value

- `Boolean` - True if the option value was successfully set, otherwise false.

### unset()

```javascript
unset(name: String): Boolean
```
Clear the set value for the specified option and revert back to the default value.

#### Parameters

- `name (String)` - Name of a registered option.

#### Return value

- `Boolean` - True if the option value was successfully reset, otherwise false.
