JS Hooks - Crocoblock/jetformbuilder GitHub Wiki
They work only after the release of JetFormBuilder 3.0.
Table of Contents
Usage example
Internal JetFormBuilder hooks work with wp-hooks package
const {
addAction,
addFilter,
} = JetPlugins.hooks;
addAction(
'jet.fb.some.action',
'my-plugin/my-function',
function ( input ) {
// any code
},
);
addFilter(
'jet.fb.some.filter',
'my-plugin/my-function',
function ( input ) {
// some changes with `input`
// we must return the input
return input;
}
);
Actions
jet.fb.observe.before
Runs before processing the entire DOM inside the form or repeater element.
Parameters
- observable
Observable
Source
jet.fb.observe.after
Runs after processing the entire DOM inside the form or repeater element.
Parameters
- observable
Observable
Source
jet.fb.input.makeReactive
It is executed every time after initialization of any field.
Parameters
- input
InputData
Source
Filters
jet.fb.inputs
Filters the set of objects that will work with each field in the form, depending on its type and settings. Each individual object is the main control element of the field behavior
Parameters
- dataTypes
InputData[]
Source
jet.fb.signals
Filters the set of objects that will work with each field in the form, depending on its type and settings. Each individual object is responsible for the changes in the DOM that should occur after the field value is updated.
Parameters
- signals
BaseSignal[]