code

Monospace textarea for code snippets. Same stored shape as `textarea` (plain string) but rendered with a fixed-width font for readability.

Stored value

string

Supports

  • Plain string values, no syntax highlighting
  • Configurable height via `rows`

Config options

rowsnumberdefault: 8
Height of the textarea, in rows.
placeholderstring
Greyed-out hint shown when the input is empty.
helpTextstring
One-line description shown below the input.

Example

json
{ "id": "ctrl_embed",
  "type": "code",
  "label": "Embed snippet",
  "attributeKey": "embed",
  "rows": 6,
  "parentPanelId": "panel" }

Gotchas

Heads up
No syntax highlighting or auto-indent — a future version may swap in CodeMirror, but for now it's a styled textarea.
Heads up
Server-side: never echo the value as HTML without escaping. For executable snippets you control, render inside `<pre><code>` after `esc_html()`.