Core en modules hooks
Deze pagina toont de 25 hooks van deze groep. Elke hook laat zijn type zien, de versie waarin hij verscheen, waar hij draait, zijn argumenten en een beginpunt.
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
FilterSinds 1.0.0 Draait in src/Plugin.php.
Filtert de body-classes van Addofy.
| Argument | Type | Beschrijving |
|---|---|---|
$extra | string[] | Classes om toe te voegen. |
$screen | Screen | Huidig scherm. |
add_filter( 'adba_body_classes', function ( $extra, $screen ) {
return $extra;
}, 10, 2 );
adba_cache_ttl
FilterSinds 2.22.0 Draait in src/Core/Cache.php.
Filtert hoe lang een cache-item van Addofy bewaard blijft, in seconden. Gebruik de groep om één soort data te raken, bijvoorbeeld ordertrends of adba_orders.
| Argument | Type | Beschrijving |
|---|---|---|
$ttl | int | Seconden. |
$group | string | Cachegroep. |
$key | string | Cachesleutel binnen de groep. |
add_filter( 'adba_cache_ttl', function ( $ttl, $group, $key ) {
return $ttl;
}, 10, 3 );
adba_combine_styles
FilterSinds 2.34.0 Draait in src/Core/StyleBundle.php.
Filtert of Addofy zijn stylesheets per reeks samenvoegt tot één bestand (opgeslagen in uploads/addofy/css). Geef false terug om elke stylesheet als eigen bestand te laden, zoals vóór 2.34.0.
| Argument | Type | Beschrijving |
|---|---|---|
$combine | bool | Standaard true, false als SCRIPT_DEBUG aan staat. |
add_filter( 'adba_combine_styles', function ( $combine ) {
return $combine;
} );
adba_compat_adapters
FilterSinds 1.0.0 Draait in src/Compat/CompatRegistry.php.
Maakt de adapters uit de filter aan en start de beschikbare.
add_filter( 'adba_compat_adapters', function ( ) {
return $value;
} );
adba_deactivate_conflicting_plugins
FilterSinds 2.23.0 Draait in src/Core/Conflicts.php.
Filtert de plugins die Addofy eenmalig uitschakelt na activatie, omdat Addofy hun taak overneemt. Elk item heeft een name en/of een text_domain uit de pluginheader. Geef een lege array terug om niets uit te schakelen.
| Argument | Type | Beschrijving |
|---|---|---|
$plugins | array<int, array{name?: string, text_domain?: string}> | Plugins om uit te schakelen. Standaard: Dashify en Dashify Pro. |
add_filter( 'adba_deactivate_conflicting_plugins', function ( $plugins ) {
return $plugins;
} );
adba_frame_disabled_modules
FilterSinds 1.0.0 Draait in src/Core/Frame.php.
Filtert de modules die binnen het frame van het bewerkpaneel uit staan.
| Argument | Type | Beschrijving |
|---|---|---|
$disabled | string[] | Module-id's. |
add_filter( 'adba_frame_disabled_modules', function ( $disabled ) {
return $disabled;
} );
adba_image_placeholder
FilterSinds 2.12.2 Draait in src/Plugin.php.
Filtert de afbeelding die wordt getoond in plaats van een lijstafbeelding die niet laadt (productminiaturen en andere afbeeldingen in lijsten, kaarten en zoekresultaten). Geef een lege string terug voor een vlak gebied dat met CSS wordt getekend.
Avatars gebruiken hem nooit. Het JavaScript-event img:fallback vuurt voor elke vervangen afbeelding.
| Argument | Type | Beschrijving |
|---|---|---|
$url | string | Placeholder-URL: de WooCommerce-placeholder, of leeg zonder WooCommerce. |
add_filter( 'adba_image_placeholder', function ( $url ) {
return $url;
} );
adba_is_excluded_screen
FilterSinds 1.0.0 Draait in src/Core/SafeMode.php.
Filtert of Addofy op een scherm uit blijft (native WordPress-uiterlijk, geen Addofy-assets).
Veilige modus wint altijd: deze filter kan Addofy niet weer aanzetten zolang veilige modus actief is.
| Argument | Type | Beschrijving |
|---|---|---|
$excluded | bool | Of het scherm is uitgesloten: waar als het op de uitsluitlijst staat of een fullscreen-app is (Customizer, site-editor). |
$screen_id | string | Scherm-id. |
$screen | Screen | Scherm. |
add_filter( 'adba_is_excluded_screen', function ( $excluded, $screen_id, $screen ) {
return $excluded;
}, 10, 3 );
adba_legacy_folder
FilterSinds 2.19.0 Draait in src/Core/Takeover.php.
Filtert het pad van de pluginmap die tot en met 2.18.0 werd gebruikt.
| Argument | Type | Beschrijving |
|---|---|---|
$folder | string | Absoluut pad, standaard wp-content/plugins/addoback. |
add_filter( 'adba_legacy_folder', function ( $folder ) {
return $folder;
} );
adba_loaded
ActionSinds 1.0.0 Draait in src/Plugin.php.
Vuurt wanneer Addofy is opgestart.
| Argument | Type | Beschrijving |
|---|---|---|
$container | Container | Servicecontainer. |
add_action( 'adba_loaded', function ( $container ) {
// ...
} );
adba_media_folder_assigned
ActionSinds 2.36.0 Draait in src/Core/MediaFolders.php.
Vuurt nadat een bijlage in een mediamap is gezet: bij uploaden, slepen, de bulkactie en importeren.
| Argument | Type | Beschrijving |
|---|---|---|
$attachment_id | int | Id van de bijlage. |
$folder_id | int | Id van de map, 0 voor geen map. |
$flags | list<string> | Vlaggen die voor de map aan staan (zie adba_media_folder_flags). |
add_action( 'adba_media_folder_assigned', function ( $attachment_id, $folder_id, $flags ) {
// ...
}, 10, 3 );
adba_media_folder_caps
FilterSinds 2.36.0 Draait in src/Core/MediaFolders.php.
Rechten voor mediamappen: manage (aanmaken, hernoemen, verwijderen, nesten) en assign (bestanden verplaatsen).
| Argument | Type | Beschrijving |
|---|---|---|
$caps | array{manage: string, assign: string} | Standaard manage_categories en upload_files. |
add_filter( 'adba_media_folder_caps', function ( $caps ) {
return $caps;
} );
adba_media_folder_flags
FilterSinds 2.36.0 Draait in src/Core/MediaFolders.php.
Vlaggen die een mediamap kan hebben. Addofy toont per vlag een vinkje in de mapinstellingen en een label in de boom, en bewaart een actieve vlag als term meta _adba_flag_<key>.
| Argument | Type | Beschrijving |
|---|---|---|
$flags | array<string, string> | Sleutel => label, bijvoorbeeld array( 'private' => 'Private' ). Standaard leeg. |
$term_id | int | Id van de map. |
add_filter( 'adba_media_folder_flags', function ( $flags, $term_id ) {
return $flags;
}, 10, 2 );
adba_migrated
ActionSinds 1.3.0 Draait in src/Core/Lifecycle.php.
Vuurt nadat Addofy zijn opgeslagen data naar een nieuwer schema heeft gemigreerd (ook bij een verse installatie, vanaf 0).
| Argument | Type | Beschrijving |
|---|---|---|
$from | int | Opgeslagen schemaversie vóór de migratie. |
$to | int | Huidige schemaversie. |
add_action( 'adba_migrated', function ( $from, $to ) {
// ...
}, 10, 2 );
adba_module_booted
ActionSinds 1.3.0 Draait in src/Modules/ModuleRegistry.php.
Vuurt nadat een module zijn hooks heeft geregistreerd. Modules starten in volgorde van hun afhankelijkheden.
Laat een extensie op een andere module wachten zonder adba_module_condition verkeerd te gebruiken.
| Argument | Type | Beschrijving |
|---|---|---|
$module_id | string | Module-id. |
$module | ModuleInterface | Module-instantie. |
add_action( 'adba_module_booted', function ( $module_id, $module ) {
// ...
}, 10, 2 );
adba_module_condition
FilterSinds 1.0.0 Draait in src/Modules/ModuleRegistry.php.
Filtert of een eigen modulevoorwaarde geldt (woocommerce, site_admin, multisite en acf zijn ingebouwd).
| Argument | Type | Beschrijving |
|---|---|---|
$met | bool | Standaard onwaar. |
$condition | string | Naam van de voorwaarde uit ModuleInterface::conditions(). |
add_filter( 'adba_module_condition', function ( $met, $condition ) {
return $met;
}, 10, 2 );
adba_module_enabled
FilterSinds 1.0.0 Draait in src/Modules/ModuleRegistry.php.
Of een module aan staat (instelling, standaard, filter, ADBA_DISABLED_MODULES), zonder naar voorwaarden te kijken.
| Argument | Type | Beschrijving |
|---|---|---|
$module | ModuleInterface | Module. |
add_filter( 'adba_module_enabled', function ( $module ) {
return $module;
} );
adba_modules
FilterSinds 1.0.0 Draait in src/Modules/ModuleRegistry.php.
Filtert de moduleclasses die Addofy laadt. Voeg een class toe die ModuleInterface implementeert om een module toe te voegen.
| Argument | Type | Beschrijving |
|---|---|---|
$classes | array<int, class-string<ModuleInterface>> | Moduleclasses. |
add_filter( 'adba_modules', function ( $classes ) {
return $classes;
} );
adba_progress_enabled
FilterSinds 1.0.0 Draait in src/Plugin.php.
Filtert of de voortgangsbalk onder de adminbalk wordt gebruikt.
| Argument | Type | Beschrijving |
|---|---|---|
$enabled | bool | Standaard waar. |
add_filter( 'adba_progress_enabled', function ( $enabled ) {
return $enabled;
} );
adba_rest_lean_boot
FilterSinds 2.20.0 Draait in src/Core/RestScope.php.
Filtert of een REST-request buiten de eigen routes van Addofy licht opstart (alleen de modules uit adba_rest_modules registreren zich). Geef false terug om alles op te starten, zoals vóór 2.20.0.
| Argument | Type | Beschrijving |
|---|---|---|
$lean | bool | Of er licht wordt opgestart. Standaard true. |
$route | string | REST-route van het request. |
add_filter( 'adba_rest_lean_boot', function ( $lean, $route ) {
return $lean;
}, 10, 2 );
adba_rest_modules
FilterSinds 2.20.0 Draait in src/Core/RestScope.php.
Filtert de id's van de ingebouwde modules die zich registreren bij een lichte REST-start. Modules die via adba_modules zijn toegevoegd, registreren zich altijd en hoeven hier niet te staan.
| Argument | Type | Beschrijving |
|---|---|---|
$modules | string[] | Module-id's. Standaard alerts, terms en flow. |
add_filter( 'adba_rest_modules', function ( $modules ) {
return $modules;
} );
adba_screen
ActionSinds 1.3.0 Draait in src/Plugin.php.
Vuurt op elk adminscherm waar Addofy actief is, nadat alle modules hun on_screen() hebben uitgevoerd.
Het aanbevolen moment voor schermspecifieke code in een extensie, bijvoorbeeld om assets in de wachtrij te zetten met adba( 'assets' )->enqueue_external(). Vuurt nooit op uitgesloten schermen, in veilige modus of op de frontend.
| Argument | Type | Beschrijving |
|---|---|---|
$screen | Screen | Huidig scherm. |
$container | Container | Servicecontainer. |
add_action( 'adba_screen', function ( $screen, $container ) {
// ...
}, 10, 2 );
adba_script_defer
FilterSinds 2.5.0 Draait in src/Core/Assets.php.
Filtert of een Addofy-script met defer vanuit de head wordt geladen. Geef onwaar terug voor het vorige gedrag: een blokkerend script in de footer.
| Argument | Type | Beschrijving |
|---|---|---|
$defer | bool | Standaard waar. |
$handle | string | Scripthandle. |
add_filter( 'adba_script_defer', function ( $defer, $handle ) {
return $defer;
}, 10, 2 );
adba_template_path
FilterSinds 1.3.0 Draait in src/Support/View.php.
Filtert het bestand waaruit een template rendert.
Draait na het opzoeken in het thema ({child-theme}/addoback/{name}.php, daarna {theme}/addoback/{name}.php). Geef het pad van een bestaand, leesbaar .php-bestand terug; al het andere valt terug op de eigen template van Addofy. Gebruik bij voorkeur de actions in de templates (bijvoorbeeld adba_customer_detail_main) om inhoud toe te voegen; overschrijf een template alleen om zijn markup te wijzigen. Templates voor instellingen en quick start gaan nooit door deze filter.
| Argument | Type | Beschrijving |
|---|---|---|
$path | string | Templatepad: de override uit het thema, of het eigen bestand van Addofy. |
$name | string | Templatenaam, bijvoorbeeld customers/detail. |
$args | array<string, mixed> | Variabelen die de template ontvangt. |
add_filter( 'adba_template_path', function ( $path, $name, $args ) {
return $path;
}, 10, 3 );
adba_uninstall
ActionSinds 1.3.0 Draait in src/Core/Lifecycle.php.
Vuurt wanneer Addofy wordt verwijderd, op multisite eenmaal per site, voordat Addofy zijn eigen data verwijdert.
Verwijder hier de opties van je extensie als de modus delete is.
| Argument | Type | Beschrijving |
|---|---|---|
$mode | string | keep of delete, de data-instelling van deze site (ADBA_DATA_ON_UNINSTALL wint). |
$site_id | int | Huidig site-id (1 op een losse site). |
add_action( 'adba_uninstall', function ( $mode, $site_id ) {
// ...
}, 10, 2 );
Klaar om het te proberen?