Skip to content
Block Controls

Code Editor

Code editor control lets you add and edit code snippets with syntax highlighting support.

Code Editor Control

Control Settings

  • Language (language) - the syntax to highlight, picked from a fixed list of 36 that runs from Arduino to YAML

No language is picked to start with, and the editor highlights nothing until you pick one. The setting changes the editor alone, so the front end gets the text exactly as it was typed whichever language is set. Without Pro the control is a plain textarea with no highlighting and no Language row.

Usage

PHP
<div>
  <?php echo $attributes['control_name']; ?>
</div>
PHP Preformatted
<pre>
  <?php echo esc_html( $attributes['control_name'] ); ?>
</pre>
Handlebars
<div>
  {{{control_name}}}
</div>
Handlebars Preformatted
<pre>
  {{control_name}}
</pre>
Post Meta
<div>
  <?php echo get_lzb_meta( 'control_meta_name' ); ?>
</div>

The value is stored and returned as plain text, so print it through esc_html() inside a <pre> when you want the code shown rather than run by the browser.

Was this article helpful?

Copyright © 2026 Lazy Blocks.