Dispaly a WYSIWYG / TinyMCE editor.
Option Details & Parameters
Type: editor
Returns: string
Can be placed in: Admin Panels , Admin Tabs , Meta Boxes , Theme Customizer (becomes a normal text
option)
Parameter | Type | Description | Ver |
---|---|---|---|
name | string | The name of the option, for display purposes only. | |
id | string | A unique ID for this option. This ID will be used to get the value for this option. | |
desc | string | The description to display together with this option. | |
default | string | (Optional) The default value for this option. | |
livepreview | string | (Optional) jQuery code that updates something in your site in the live preview. Only used when the option is placed in a theme customizer section. Refer to Livepreview for more information on this parameter. | |
wpautop | boolean | (Optional) If true, the text entered will be wrapped with paragraph tags via wpautop . Defaults to true |
|
media_buttons | boolean | (Optional) If true, an Add Media button will be placed alongside the wysiwyg editor. Defaults to true . |
|
rows | int | (Optional) The number of rows in the wysiwyg editor. Defaults to 10 |
|
editor_settings | array | (Optional) Additional settings to pass to the creation of the editor area. This is basically the 3rd argument to the wp_editor() function used to create the editor. More information at the Codex: https://codex.wordpress.org/Function_Reference/wp_editor |
1.9 |
css | string | (Optional) CSS rules to be used with this option. Only used when the option is placed in an admin page / panel or a theme customizer section. Refer to Generate CSS Automatically for your options for more information on this parameter. |
Examples
Creating a wysiwyg editor option:
$panel->createOption( array( 'name' => 'My Editor Option', 'id' => 'my_editor_option', 'type' => 'editor', 'desc' => 'Put your footer content here' ) );
Adding editor styles:
$panel->createOption( array( 'name' => 'My Editor Option', 'id' => 'my_editor_option', 'type' => 'editor', 'desc' => 'Put your footer content here', 'editor_settings' => array( 'tinymce' => array( 'content_css' => 'path/to/editor-styles.css', ), ), ) );
Notes
[zilla_alert]The theme customizer area is too narrow for the editor. If used in a customizer section, this option will revert back to a normal text
option.[/zilla_alert]