-
Notifications
You must be signed in to change notification settings - Fork 0
Hooks
Ale Mostajo edited this page Apr 29, 2020
·
1 revision
List of important WordPress hooks:
add_filter( 'metaboxer_models', function( $models ) { ... } );
Triggered to initialize the Add-on models.
Parameter | Data type | Description |
---|---|---|
$models | array |
Array with the list of registered metaboxer models. |
Data type | Description |
---|---|
array |
Array with the list of registered metaboxer models. |
add_filter( 'metaboxer_controls', function( $controls ) { ... } );
Triggered to initialize the Add-on controls.
Parameter | Data type | Description |
---|---|---|
$controls | array |
Array with the list of registered controls. |
Data type | Description |
---|---|
array |
Array with the list of registered controls. |
add_filter( 'metaboxer_no_value_fields', function( $types ) { ... } );
Returns list of control types that do not handle values (i.e. section_open
, callback
and similar).
Parameter | Data type | Description |
---|---|---|
$types | array |
Control types. |
Data type | Description |
---|---|
array |
Control types. |
add_filter( 'metaboxer_bool_fields', function( $types ) { ... } );
Returns list of control types that should behave as boolean
, specially the moment the Add-on tries to read its value from the POST data. (i.e. checkbox
).
Parameter | Data type | Description |
---|---|---|
$types | array |
Control types. |
Data type | Description |
---|---|
array |
Control types. |
add_filter( 'metaboxer_model_{model_id}', function( $model, $metabox_id ) { ... }, 10, 2 );
Triggered before a metabox is rendered.
Parameter | Data type | Description |
---|---|---|
$model | object |
Post model. |
$metabox_id | string |
Metabox ID to be rendered. |
Data type | Description |
---|---|
object |
Post model. |
add_action( 'metaboxer_model_saved_{model_id}', function( $model ) { ... }, 10 );
Triggered right after the model is saved in the database.
Parameter | Data type | Description |
---|---|---|
$model | object |
Post model. |
add_filter( 'metaboxer_model_fields_{model_id}', function( $fields, $model, $metabox_id, $tab_id ) { ... }, 10, 4 );
Triggered after fields have been processed (per tab), before rendering.
Parameter | Data type | Description |
---|---|---|
$fields | array |
Processed fields. |
$model | object |
Settings model. |
$metabox_id | string |
Current metabox ID. |
*$tab_id * | string |
Current tab ID. |
Data type | Description |
---|---|
array |
Processed fields. |
(c) 2020 10 Quality Studio.