VAT
Your cart

Your cart is empty.

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_classes

FilterSince 1.0.0 Runs in src/Plugin.php.

Filters the Addofy body classes.

ArgumentTypeDescription
$extrastring[]Classes to add.
$screenScreenCurrent 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.

ArgumentTypeDescription
$ttlintSeconds.
$groupstringCache group.
$keystringCache 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.

ArgumentTypeDescription
$combineboolDefault 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.

ArgumentTypeDescription
$pluginsarray<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.

ArgumentTypeDescription
$disabledstring[]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.

ArgumentTypeDescription
$urlstringPlaceholder 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.

ArgumentTypeDescription
$excludedboolWhether the screen is excluded, true when it is on the exclusion list or a full-screen app (Customizer, site editor).
$screen_idstringScreen id.
$screenScreenScreen.
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.

ArgumentTypeDescription
$folderstringAbsolute 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.

ArgumentTypeDescription
$containerContainerService 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.

ArgumentTypeDescription
$attachment_idintAttachment id.
$folder_idintFolder id, 0 for no folder.
$flagslist<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).

ArgumentTypeDescription
$capsarray{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>.

ArgumentTypeDescription
$flagsarray<string, string>Key => label, for example array( 'private' => 'Private' ). Default empty.
$term_idintFolder 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).

ArgumentTypeDescription
$fromintStored schema version before the migration.
$tointCurrent 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.

ArgumentTypeDescription
$module_idstringModule id.
$moduleModuleInterfaceModule 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).

ArgumentTypeDescription
$metboolDefault false.
$conditionstringCondition 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.

ArgumentTypeDescription
$moduleModuleInterfaceModule.
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.

ArgumentTypeDescription
$classesarray<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.

ArgumentTypeDescription
$enabledboolDefault 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.

ArgumentTypeDescription
$leanboolWhether to boot lean. Default true.
$routestringREST 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.

ArgumentTypeDescription
$modulesstring[]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.

ArgumentTypeDescription
$screenScreenCurrent screen.
$containerContainerService 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.

ArgumentTypeDescription
$deferboolDefault true.
$handlestringScript 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.

ArgumentTypeDescription
$pathstringTemplate path: the theme override, or Addofy's own file.
$namestringTemplate name, for example customers/detail.
$argsarray<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.

ArgumentTypeDescription
$modestringkeep or delete, the data setting of this site (ADBA_DATA_ON_UNINSTALL wins).
$site_idintCurrent site id (1 on a single site).
add_action( 'adba_uninstall', function ( $mode, $site_id ) {
	// ...
}, 10, 2 );

Ready to connect your AI to real tools?

Start free trial