Skip to content
Ale Mostajo edited this page Apr 29, 2020 · 1 revision

List of important WordPress hooks:

metaboxer_models

add_filter( 'metaboxer_models', function( $models ) { ... } );

Triggered to initialize the Add-on models.

Parameters

Parameter Data type Description
$models array Array with the list of registered metaboxer models.

Returns

Data type Description
array Array with the list of registered metaboxer models.

metaboxer_controls

add_filter( 'metaboxer_controls', function( $controls ) { ... } );

Triggered to initialize the Add-on controls.

Parameters

Parameter Data type Description
$controls array Array with the list of registered controls.

Returns

Data type Description
array Array with the list of registered controls.

metaboxer_no_value_fields

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).

Parameters

Parameter Data type Description
$types array Control types.

Returns

Data type Description
array Control types.

metaboxer_bool_fields

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).

Parameters

Parameter Data type Description
$types array Control types.

Returns

Data type Description
array Control types.

metaboxer_model_{model_id}

add_filter( 'metaboxer_model_{model_id}', function( $model, $metabox_id ) { ... }, 10, 2 );

Triggered before a metabox is rendered.

Parameters

Parameter Data type Description
$model object Post model.
$metabox_id string Metabox ID to be rendered.

Returns

Data type Description
object Post model.

metaboxer_model_saved_{model_id}

add_action( 'metaboxer_model_saved_{model_id}', function( $model ) { ... }, 10 );

Triggered right after the model is saved in the database.

Parameters

Parameter Data type Description
$model object Post model.

metaboxer_model_fields_{model_id}

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.

Parameters

Parameter Data type Description
$fields array Processed fields.
$model object Settings model.
$metabox_id string Current metabox ID.
*$tab_id * string Current tab ID.

Returns

Data type Description
array Processed fields.