Core and modules hooks
This page lists the 25 hooks of this group. Each entry shows its type, the version it arrived in, where it runs, its arguments and a starting point.
adba_body_classesadba_cache_ttladba_combine_stylesadba_compat_adaptersadba_deactivate_conflicting_pluginsadba_frame_disabled_modulesadba_image_placeholderadba_is_excluded_screenadba_legacy_folderadba_loadedadba_media_folder_assignedadba_media_folder_capsadba_media_folder_flagsadba_migratedadba_module_bootedadba_module_conditionadba_module_enabledadba_modulesadba_progress_enabledadba_rest_lean_bootadba_rest_modulesadba_screenadba_script_deferadba_template_pathadba_uninstall
adba_body_classes
FilterSince 1.0.0 Runs in src/Plugin.php.
Filters the Addofy body classes.
| Argument | Type | Description |
|---|---|---|
$extra | string[] | Classes to add. |
$screen | Screen | Current screen. |
add_filter( 'adba_body_classes', function ( $extra, $screen ) {
return $extra;
}, 10, 2 );
adba_cache_ttl
FilterSince 2.22.0 Runs in src/Core/Cache.php.
Filters how long an Addofy cache entry lives, in seconds.
Use the group to target one kind of data, for example ordertrends or adba_orders.
| Argument | Type | Description |
|---|---|---|
$ttl | int | Seconds. |
$group | string | Cache group. |
$key | string | Cache key within the group. |
add_filter( 'adba_cache_ttl', function ( $ttl, $group, $key ) {
return $ttl;
}, 10, 3 );
adba_combine_styles
FilterSince 2.34.0 Runs in src/Core/StyleBundle.php.
Filters whether Addofy joins its stylesheets into one file per run (stored in uploads/addofy/css). Return false to load every stylesheet as its own file, as before 2.34.0.
| Argument | Type | Description |
|---|---|---|
$combine | bool | Default true, false when SCRIPT_DEBUG is on. |
add_filter( 'adba_combine_styles', function ( $combine ) {
return $combine;
} );
adba_compat_adapters
FilterSince 1.0.0 Runs in src/Compat/CompatRegistry.php.
Instantiates the adapters from the filter and boots the available ones.
add_filter( 'adba_compat_adapters', function ( ) {
return $value;
} );
adba_deactivate_conflicting_plugins
FilterSince 2.23.0 Runs in src/Core/Conflicts.php.
Filters the plugins Addofy switches off once after it is activated, because it takes over their job.
Each item has a name and/or a text_domain from the plugin header. Return an empty array to switch nothing off.
| Argument | Type | Description |
|---|---|---|
$plugins | array<int, array{name?: string, text_domain?: string}> | Plugins to switch off. Default: Dashify and Dashify Pro. |
add_filter( 'adba_deactivate_conflicting_plugins', function ( $plugins ) {
return $plugins;
} );
adba_frame_disabled_modules
FilterSince 1.0.0 Runs in src/Core/Frame.php.
Filters the modules that are off inside the drawer frame.
| Argument | Type | Description |
|---|---|---|
$disabled | string[] | Module ids. |
add_filter( 'adba_frame_disabled_modules', function ( $disabled ) {
return $disabled;
} );
adba_image_placeholder
FilterSince 2.12.2 Runs in src/Plugin.php.
Filters the picture shown in place of a list image that does not load (product thumbnails and other pictures in lists, cards and search results). Return an empty string for a flat area drawn by CSS. Avatars never use it. The JavaScript event img:fallback fires for each swapped picture.
| Argument | Type | Description |
|---|---|---|
$url | string | Placeholder URL: the WooCommerce placeholder, or empty without WooCommerce. |
add_filter( 'adba_image_placeholder', function ( $url ) {
return $url;
} );
adba_is_excluded_screen
FilterSince 1.0.0 Runs in src/Core/SafeMode.php.
Filters whether Addofy stays off on a screen (native WordPress look, no Addofy assets).
Safe mode always wins: this filter cannot switch Addofy back on while it is active.
| Argument | Type | Description |
|---|---|---|
$excluded | bool | Whether the screen is excluded, true when it is on the exclusion list or a full-screen app (Customizer, site editor). |
$screen_id | string | Screen id. |
$screen | Screen | Screen. |
add_filter( 'adba_is_excluded_screen', function ( $excluded, $screen_id, $screen ) {
return $excluded;
}, 10, 3 );
adba_legacy_folder
FilterSince 2.19.0 Runs in src/Core/Takeover.php.
Filters the path of the plugin folder used up to 2.18.0.
| Argument | Type | Description |
|---|---|---|
$folder | string | Absolute path, by default wp-content/plugins/addoback. |
add_filter( 'adba_legacy_folder', function ( $folder ) {
return $folder;
} );
adba_loaded
ActionSince 1.0.0 Runs in src/Plugin.php.
Fires when Addofy has booted.
| Argument | Type | Description |
|---|---|---|
$container | Container | Service container. |
add_action( 'adba_loaded', function ( $container ) {
// ...
} );
adba_media_folder_assigned
ActionSince 2.36.0 Runs in src/Core/MediaFolders.php.
Fires after an attachment was put in a media folder: on upload, drag, bulk action and import.
| Argument | Type | Description |
|---|---|---|
$attachment_id | int | Attachment id. |
$folder_id | int | Folder id, 0 for no folder. |
$flags | list<string> | Flags that are on for the folder (see adba_media_folder_flags). |
add_action( 'adba_media_folder_assigned', function ( $attachment_id, $folder_id, $flags ) {
// ...
}, 10, 3 );
adba_media_folder_caps
FilterSince 2.36.0 Runs in src/Core/MediaFolders.php.
Capabilities for media folders: manage (create, rename, delete, nest) and assign (move files).
| Argument | Type | Description |
|---|---|---|
$caps | array{manage: string, assign: string} | Default manage_categories and upload_files. |
add_filter( 'adba_media_folder_caps', function ( $caps ) {
return $caps;
} );
adba_media_folder_flags
FilterSince 2.36.0 Runs in src/Core/MediaFolders.php.
Flags a media folder can have. Addofy shows a checkbox per flag in the folder settings and a label in the tree, and stores an active flag as term meta _adba_flag_<key>.
| Argument | Type | Description |
|---|---|---|
$flags | array<string, string> | Key => label, for example array( 'private' => 'Private' ). Default empty. |
$term_id | int | Folder id. |
add_filter( 'adba_media_folder_flags', function ( $flags, $term_id ) {
return $flags;
}, 10, 2 );
adba_migrated
ActionSince 1.3.0 Runs in src/Core/Lifecycle.php.
Fires after Addofy migrated its stored data to a newer schema (also on a fresh install, from 0).
| Argument | Type | Description |
|---|---|---|
$from | int | Stored schema version before the migration. |
$to | int | Current schema version. |
add_action( 'adba_migrated', function ( $from, $to ) {
// ...
}, 10, 2 );
adba_module_booted
ActionSince 1.3.0 Runs in src/Modules/ModuleRegistry.php.
Fires after a module registered its hooks. Modules boot in dependency order.
Lets an extension wait for another module without misusing adba_module_condition.
| Argument | Type | Description |
|---|---|---|
$module_id | string | Module id. |
$module | ModuleInterface | Module instance. |
add_action( 'adba_module_booted', function ( $module_id, $module ) {
// ...
}, 10, 2 );
adba_module_condition
FilterSince 1.0.0 Runs in src/Modules/ModuleRegistry.php.
Filters whether a custom module condition holds (woocommerce, site_admin, multisite and acf are built in).
| Argument | Type | Description |
|---|---|---|
$met | bool | Default false. |
$condition | string | Condition name from ModuleInterface::conditions(). |
add_filter( 'adba_module_condition', function ( $met, $condition ) {
return $met;
}, 10, 2 );
adba_module_enabled
FilterSince 1.0.0 Runs in src/Modules/ModuleRegistry.php.
Whether a module is switched on (setting, default, filter, ADBA_DISABLED_MODULES), ignoring conditions.
| Argument | Type | Description |
|---|---|---|
$module | ModuleInterface | Module. |
add_filter( 'adba_module_enabled', function ( $module ) {
return $module;
} );
adba_modules
FilterSince 1.0.0 Runs in src/Modules/ModuleRegistry.php.
Filters the module classes Addofy loads. Add a class that implements ModuleInterface to add a module.
| Argument | Type | Description |
|---|---|---|
$classes | array<int, class-string<ModuleInterface>> | Module classes. |
add_filter( 'adba_modules', function ( $classes ) {
return $classes;
} );
adba_progress_enabled
FilterSince 1.0.0 Runs in src/Plugin.php.
Filters whether the progress bar under the admin bar is used.
| Argument | Type | Description |
|---|---|---|
$enabled | bool | Default true. |
add_filter( 'adba_progress_enabled', function ( $enabled ) {
return $enabled;
} );
adba_rest_lean_boot
FilterSince 2.20.0 Runs in src/Core/RestScope.php.
Filters whether a REST request outside Addofy's own routes boots lean (only the modules from adba_rest_modules register). Return false to boot everything, as before 2.20.0.
| Argument | Type | Description |
|---|---|---|
$lean | bool | Whether to boot lean. Default true. |
$route | string | REST route of the request. |
add_filter( 'adba_rest_lean_boot', function ( $lean, $route ) {
return $lean;
}, 10, 2 );
adba_rest_modules
FilterSince 2.20.0 Runs in src/Core/RestScope.php.
Filters the ids of the built-in modules that register on a lean REST boot. Modules added through adba_modules always register, so they need no entry here.
| Argument | Type | Description |
|---|---|---|
$modules | string[] | Module ids. Default alerts, terms and flow. |
add_filter( 'adba_rest_modules', function ( $modules ) {
return $modules;
} );
adba_screen
ActionSince 1.3.0 Runs in src/Plugin.php.
Fires on every admin screen where Addofy is active, after all modules ran their on_screen().
The recommended moment for screen-specific code in an extension, for example to queue assets with adba( 'assets' )->enqueue_external(). Never fires on excluded screens, in safe mode or on the frontend.
| Argument | Type | Description |
|---|---|---|
$screen | Screen | Current screen. |
$container | Container | Service container. |
add_action( 'adba_screen', function ( $screen, $container ) {
// ...
}, 10, 2 );
adba_script_defer
FilterSince 2.5.0 Runs in src/Core/Assets.php.
Filters whether an Addofy script is loaded with defer from the head. Return false for the previous behaviour, a blocking script in the footer.
| Argument | Type | Description |
|---|---|---|
$defer | bool | Default true. |
$handle | string | Script handle. |
add_filter( 'adba_script_defer', function ( $defer, $handle ) {
return $defer;
}, 10, 2 );
adba_template_path
FilterSince 1.3.0 Runs in src/Support/View.php.
Filters the file a template renders from.
Runs after the theme lookup ({child-theme}/addoback/{name}.php, then {theme}/addoback/{name}.php). Return the path of an existing, readable .php file; anything else falls back to Addofy's own template. Prefer the actions inside the templates (for example adba_customer_detail_main) to add content; override a template only to change its markup. Settings and quick start templates never pass through this filter.
| Argument | Type | Description |
|---|---|---|
$path | string | Template path: the theme override, or Addofy's own file. |
$name | string | Template name, for example customers/detail. |
$args | array<string, mixed> | Variables the template receives. |
add_filter( 'adba_template_path', function ( $path, $name, $args ) {
return $path;
}, 10, 3 );
adba_uninstall
ActionSince 1.3.0 Runs in src/Core/Lifecycle.php.
Fires when Addofy is uninstalled, once per site on multisite, before Addofy removes its own data.
Remove the options of your extension here when the mode is delete.
| Argument | Type | Description |
|---|---|---|
$mode | string | keep or delete, the data setting of this site (ADBA_DATA_ON_UNINSTALL wins). |
$site_id | int | Current site id (1 on a single site). |
add_action( 'adba_uninstall', function ( $mode, $site_id ) {
// ...
}, 10, 2 );