JS Filters
lzb.editor.control.getValue
Filters control value when retrieving it.
Attributes
Name | Type | Description |
---|---|---|
val | Mixed | control value |
control | Object | control data |
childIndex | Int | control index inside a repeater |
Additional Filters
Name | Description |
---|---|
lzb.editor.control.CONTROL_TYPE.getValue | specific controls only |
Usage
JS
wp.hooks.addFilter(
"lzb.editor.control.getValue",
"my.custom.namespace",
function (val, control, childIndex) {
console.log(val, control, childIndex);
return val;
}
);
JS
wp.hooks.addFilter(
"lzb.editor.control.checkbox.getValue",
"my.custom.namespace",
function (val, control, childIndex) {
console.log(val, control, childIndex);
return val;
}
);