Skip to content
JS Filters

lzb.constructor.control.settings

Fills the control-specific slot in the block builder's settings panel, the gap between the Type row and the Default row where a control type puts the settings only it has. Every Pro control that carries its own options registers here, lzb.constructor.control.units.settings for the unit list, lzb.constructor.control.message.settings for the message text.

Attributes

NameTypeDescription
renderJSX | Stringwhat the type-specific filter returned, '' when none ran
propsObjectdata, id, updateData, controlTypeData
NameTypeDescription
dataObjectthe selected control's settings: type, name, label, default and any of its own
idStringkey of this control inside the block's controls object
updateDataFunctionmerges settings into the control, updateData({ units: "px,em" })
controlTypeDataObjectthe registered control type: name, icon, type, label, category, restrictions, attributes

Additional Filters

NameDescription
lzb.constructor.control.CONTROL_TYPE.settingsone control type only, and it runs before the generic filter

The type-specific filter is applied first with '' as its starting value, then this one runs on whatever came back. So a handler on the generic name sees the type-specific markup and can add to it or drop it.

Usage

JS
wp.hooks.addFilter(
  "lzb.constructor.control.my_json.settings",
  "my.custom.namespace",
  function (render, props) {
    const { TextareaControl, PanelBody } = wp.components;
 
    return (
      <PanelBody>
        {render}
        <TextareaControl
          label="Schema"
          help="JSON schema the control validates against."
          value={props.data.my_json_schema || ""}
          onChange={(value) => props.updateData({ my_json_schema: value })}
        />
      </PanelBody>
    );
  },
);

Settings written with updateData are saved on the control record, so the same key is readable from PHP and from the editor filters. Adding or removing whole rows is a different job. lzb.constructor.control.settings-rows takes the map of row components and lets you insert your own row or delete a built-in one, while this filter only fills the one slot the plugin has reserved for control types.

Was this article helpful?

Copyright © 2026 Lazy Blocks.