registerSettingsControl()

Function of @webcodingcat/wp-app-framework/settings.

import { registerSettingsControl } from '@webcodingcat/wp-app-framework/settings';
function registerSettingsControl<V = unknown>(group: string, path: string | string[], component: Component<SettingsControlProps<V>>): void

Replaces the control of a value of a settings group on the settings page: a setting, a field of a value class in it or each item of a list.

ParameterTypeDescription
groupstringThe name of the group, as in #[SettingsGroup(name: …)].
pathstring | string[]The setting, then the fields below it and * for the items of a list: 'schemes', ['schemes', '*'], ['contact', 'email']. A string names a setting.
componentComponent<SettingsControlProps<V>>The control; it receives the value, onChange, the path with list indices, the value of the group and the generated control as DefaultControl.