This documentation describes unreleased changes on the main branch.

registerControl()

Function of @saij/wp-app-framework.

import { registerControl } from '@saij/wp-app-framework';
function registerControl<V = unknown>(block: string, attribute: string, component: Component<ControlProps<V>>): void

Replaces the generated inspector control of an attribute of a block: a top-level attribute of its attribute class or the attribute of a block support the block uses. It wins over registerSupportControl().

ParameterTypeDescription
blockstringThe block name without namespace, e.g. hero; the namespace of your theme or plugin is added.
attributestringThe name of the attribute.
componentComponent<ControlProps<V>>The control; it receives the value of the attribute, onChange and the block props.