Settings hooks
This page lists the 3 hooks of this group. Each entry shows its type, the version it arrived in, where it runs, its arguments and a starting point.
addochat_effective_settings
FilterSince 0.1.0 Runs in src/Config/Effective.php.
Filters the settings that apply on this site, after the central site's document and the kill switch. Stored as one autoloaded option; runs only when a source changes, not on every request.
| Argument | Type | Description |
|---|---|---|
$current | array<string, mixed> | Settings by key; i18n fields are arrays locale => text. |
add_filter( 'addochat_effective_settings', function ( $current ) {
return $current;
} );
addochat_settings_changed
ActionSince 0.1.0 Runs in src/Config/Effective.php.
Fires after the settings that apply on this site changed.
| Argument | Type | Description |
|---|---|---|
$current | array<string, mixed> | New settings. |
$previous | array<string, mixed> | Old settings, empty the first time. |
add_action( 'addochat_settings_changed', function ( $current, $previous ) {
// ...
}, 10, 2 );
addochat_settings_fields
FilterSince 0.1.0 Runs in src/Settings.php.
Filters the settings fields of AddoChat. A field added here shows on the settings page and in the Addofy settings search, and is stored in the same option.
| Argument | Type | Description |
|---|---|---|
$fields | array<string, array<string, mixed>> | Fields by key: type (text, url, textarea, bool, select, int or color), section, label, description, default, and when needed placeholder (color), options (select), min and max (int), i18n (text and textarea) and local. |
add_filter( 'addochat_settings_fields', function ( $fields ) {
return $fields;
} );