-
Notifications
You must be signed in to change notification settings - Fork 2
Hooks
List of important WordPress hooks:
add_filter( 'administrator_models', function( $models ) { ... } );Triggered during admin init, to initialize the Add-on.
| Parameter | Data type | Description |
|---|---|---|
| $models | array |
Array with the list of registered settings models. |
| Data type | Description |
|---|---|
array |
Array with the list of registered settings models. |
add_filter( 'administrator_controls', function( $controls ) { ... } );Triggered during admin init, to initialize the Add-on.
| 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( 'administrator_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( 'administrator_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( 'administrator_preload_model_{model_id}', function( $model, $current_tab ) { ... }, 10, 2 );Triggered before the model is loaded, right after the $model and $current_tab are identified.
| Parameter | Data type | Description |
|---|---|---|
| $model | object |
Settings model. |
| $current_tab | string |
Current tab. |
| Data type | Description |
|---|---|
object |
Settings model. |
add_filter( 'administrator_settings_before_save_{model_id}', function( $model, $current_tab ) { ... }, 10, 2 );Triggered before the model is saved, right after the $model has been loaded from the database.
| Parameter | Data type | Description |
|---|---|---|
| $model | object |
Settings model. |
| $current_tab | string |
Current tab. |
| Data type | Description |
|---|---|
object |
Settings model. |
add_action( 'administrator_settings_saved_{model_id}', function( $model, $current_tab ) { ... }, 10, 2 );Triggered right after the model is saved in the database.
| Parameter | Data type | Description |
|---|---|---|
| $model | object |
Settings model. |
| $current_tab | string |
Current tab. |
add_filter( 'administrator_model_{model_id}', function( $model, $current_tab ) { ... }, 10, 2 );Triggered before rendering, after the $model has been loaded and saved.
| Parameter | Data type | Description |
|---|---|---|
| $model | object |
Settings model. |
| $current_tab | string |
Current tab. |
| Data type | Description |
|---|---|
object |
Settings model. |
add_filter( 'administrator_model_fields_{model_id}', function( $fields, $model, $current_tab ) { ... }, 10, 3 );Triggered after fields have been processed, before rendering.
| Parameter | Data type | Description |
|---|---|---|
| $fields | array |
Processed fields. |
| $model | object |
Settings model. |
| $current_tab | string |
Current tab. |
| Data type | Description |
|---|---|
array |
Processed fields. |
(c) 2020 10 Quality Studio.