1. Home
  2. Docs
  3. WordPress Studio Framework
  4. Framework Fields
  5. WP Editor Field

WP Editor Field

Note: This field is for the Classic WordPress editor based on the TinyMCE code. This is not for the newer Block WordPress editor (Gutenberg).

Arguments

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value
typestringwp_editorType of the field
titlestring Title of the field
defaultstring Default value from database, if the option doesn’t exist
subtitlestring Subtitle to display below the title
descstring Description to display after the field
helpstring Text to display on right-corner (as hover/popup) the field
classstring Extra CSS classes (space separated) to append to the field
beforestring Content to display before the field
afterstring Content to display after the field
dependencyarray Define field visibility depending on other field value
attributesarray Extra HTML attributes to append to the field
sanitizestring Callback function for sanitizing value
validatestring Callback function for validating value
EXTRAS   
tinymcebooltrueFlag to load TinyMCE
quicktagsbooltrueFlag to load Quicktags
media_buttonsbooltrueFlag to display media insert/upload buttons
heightstring250pxThe height of the editor area.

Simple WP Editor Field Example

array(
  'id' => 'example-wp-editor',
  'type' => 'wp_editor',
  'title' => 'WordPress Editor',
),

WP Editor Field Example with Custom Settings

array(
  'id' => 'example-wp-editor',
  'type' => 'wp_editor',
  'title' => 'WordPress Editor',
  'tinymce' => true,
  'quicktags' => true,
  'media-buttons' => true,
  'height' => '100px',
),
Was this article helpful to you? Yes No

How can we help?