Skip to content
Controls

Controls

Controls let users customize blocks by managing block attributes in the block editor. Each control handles different types of data - from simple text inputs to complex file uploaders and repeaters. When the block renders, you can access these values to output them in your block.

Adding Controls

Add controls to your block using the "Add Control" button in the block builder. You can add multiple controls to manage different aspects of your block.

Adding a new control in Lazy Blocks

Control Settings

Each control has a set of common settings that determine how it works and displays:

Control settings panel

Basic Settings

  • Label - The name shown in the block editor
  • Name - Unique identifier for accessing the control's value in code
  • Type - The kind of control (Text, Select, Image, etc.)
  • Default value - Initial value when adding a new block

Display Settings

  • Placement - Where the control appears (Content or Inspector)
  • Width - Control width in Content area (25%, 50%, 75%, 100%)
  • Help text - Additional information shown below the control

Advanced Settings

  • Required - Prevent publishing if the control is empty
  • Hide if block is not selected - Only show when block is active
  • WPML Translation - Makes Text controls available for translation in WPML plugin. Learn more here
  • Save in Meta - Store value in custom meta field
  • Conditional Logic - Show/hide based on other controls

Control Placement

Block control placement

Control can be added in 2 places: Inspector and Content (inside block body). Example:

Block control placement

Inspector Groups

When placing controls in the Inspector panel, you can organize them into specific groups:

  • Default - Standard inspector controls group
  • Styles - Group for styling-related controls
  • Advanced - Group for advanced block settings

This grouping helps organize your block controls in a way that matches WordPress core blocks structure, making it more intuitive for users familiar with the block editor.

Custom Meta Field

Block control custom meta field

Each control has the possibility to save its value in the custom fields, so this value will be available in the post meta data and developers may get this value. For example:

<p><?php echo get_lzb_meta( 'control_meta_name' ); ?></p>

You should add a unique custom field name, as 3rd-party plugins/themes may use the same name and it will be conflicted. For example, if you want to use this block in your theme "My Super Theme", we recommend adding slug name – mst_control_meta_name.

Reserved Control Names

There are reserved control names that you shouldn't use:

NameDescription
lazyblockinternal block data used by Lazy Blocks plugin
classNameblock custom classname
alignblock align
anchorblock custom ID
blockIdblock unique ID, generates automatically
blockUniqueClassblock unique class, generates automatically

All Controls

Basic

Email Control
Email
Number Control
Number
Password Control
Password
Range Control
Range
Text Control
Text
Textarea Control
Textarea
URL Control
URL

Content

Classic Editor Control
Classic Editor
Code Editor Control
Code Editor
File Control
File
Gallery Control
Gallery
Image Control
Image
Rich Text Control
Rich Text

Choice

Checkbox Control
Checkbox
Radio Control
Radio
Select Control
Select
Toggle Control
Toggle

Advanced

Color Picker Control
Color Picker
Date Time Picker Control
Date Time Picker
Posts Control
Posts
Taxonomy Control
Taxonomy
Units Control
Units
Users Control
Users

Layout

Divider Control
Divider
Message Control
Message
Panel Control
Panel
Repeater Control
Repeater

Was this article helpful?