These hooks run during plugin bootstrap, activation/deactivation, database maintenance, and global service registration. They are the right place to register your own services or react to plugin lifecycle events.
Source: Plugin.php, Maintenance.php, infrastructure service providers. Index: Hook Reference Hub. Boot order: Getting Started for Developers.
Plugin lifecycle (actions)
| Hook | Parameters | Description |
|---|---|---|
notifal/initialized | none | Core plugin class finished initializing; safe to call notifal_app() and register module hooks |
notifal/ready | none | Plugin fully loaded and ready |
notifal/activated | none | Fires on plugin activation (Maintenance.php) |
notifal/deactivated | none | Fires on plugin deactivation |
notifal/uninstalling | none | Fires during uninstall cleanup |
notifal/deactivation/feedback_submitted | array $feedback_data | Deactivation survey submitted |
notifal/deactivation/feedback_skipped | array $site_data | Deactivation survey skipped |
notifal/onpage_post_type/registered | none | On-page notification CPT registered |
Pro equivalent: notifal_pro/initialized (see Pro Integration Bridge).
Infrastructure and module services (filters)
Register or replace service classes before they are booted.
| Hook | Parameters | Description |
|---|---|---|
notifal/infrastructure/services | string[] $services | Global infrastructure service class names (admin menu, shared assets, etc.) |
notifal/onpage/services | string[] $services | OnPageNotification module services |
notifal/templates/services | string[] $services | Templates module services |
notifal/tags/services | string[] $services | Tags domain services |
notifal/settings/services | string[] $services | Settings domain services |
notifal/deactivation/services | string[] $services | Deactivation popup services |
notifal/campaign/services | string[] $services | Campaign module services |
Each entry is a fully qualified class name with a static or instance register() method. See Architecture Overview for the service provider pattern.
Post type registration (filters)
| Hook | Parameters | Description |
|---|---|---|
notifal/onpage_post_type/args | array $args | On-page notification CPT registration arguments |
notifal/template_post_type/args | array $args | Template CPT registration arguments |
notifal/post_type_discovery/excluded_types | string[] $excludedTypes | Post types excluded from tag-generation discovery |
Database migrations and cleanup (actions)
| Hook | Parameters | Description |
|---|---|---|
notifal/database/migrations/before_run | none | Before global database migrations |
notifal/database/migrations/after_run | none | After global database migrations |
notifal/database/cleanup/completed | none | After old data cleanup finishes |
notifal/database/cleanup_old_data | int $daysOld | Trigger cleanup of data older than N days |
notifal/onpage/database/migrations/before_run | string $fromVersion, string $toVersion | Before OnPage module migrations |
notifal/onpage/database/migrations/after_run | string $fromVersion, string $toVersion | After OnPage module migrations |
notifal/onpage/database/cleanup/completed | none | After OnPage-specific DB cleanup |
notifal/onpage/database/tables_cleaned_up | none | After OnPage table cleanup; extend with custom cleanup |
Database table registry (filter)
| Hook | Parameters | Description |
|---|---|---|
notifal/database/table_names | array $tables | Register custom table names for maintenance operations |
Event queue and cron (actions)
Background processing for tracking and related events.
| Hook | Parameters | Description |
|---|---|---|
notifal/onpage/event/before_queue | array $eventData | Before an event is queued |
notifal/onpage/event/after_queue | int $queueId, array $eventData | After an event is queued |
notifal/onpage/event/processing/before | int $batchSize | Before processing a batch of queued events |
notifal/onpage/event/processing/after | int $processedCount, int $errorCount, float $processingTime | After batch processing (time in ms) |
notifal/onpage/cron/processing/completed | array $result | After cron event processing run |
notifal/onpage/cron/cleanup/completed | array $result | After cron queue cleanup |
notifal/campaign/cron/end_date_expiry_completed | int $updated_count | After hourly job marks expired campaigns inactive |
Related filters: notifal/onpage/event/queue_data, notifal/onpage/tracking/use_queue in Analytics and Tracking.
Global settings (actions and filters)
| Hook | Type | Parameters | Description |
|---|---|---|---|
notifal/setting/updated | action | string $key, mixed $value | A setting value was saved |
notifal/settings/reset | action | none | All settings reset to defaults |
notifal/generated_tags/saved | action | none | Generated custom post type tags saved |
notifal/generated_tags/removed | action | none | Generated tags removed |
Settings page UI hooks live in Admin UI Extension.
Frontend asset registration (actions)
| Hook | Parameters | Description |
|---|---|---|
notifal/frontend/assets/before_register | none | Before frontend scripts/styles are registered |
notifal/frontend/assets/after_register | none | After frontend registration |
notifal/frontend/assets/before_enqueue | none | Before conditional frontend enqueue |
notifal/frontend/assets/after_enqueue | none | After conditional frontend enqueue |
On-page-specific load decisions: notifal/onpage/frontend/should_load_assets and related filters in Notifications and Eligibility.
Gutenberg block rendering (actions)
Dynamic hook pattern: append the block slug to the base constant.
| Base hook | Parameters | Description |
|---|---|---|
notifal/block/render/before + _{block_slug} | varies | Before a Notifal block renders on the frontend |
notifal/block/render/after + _{block_slug} | varies | After a Notifal block renders |
Toast notifications (filter)
Admin redirect toast messages after save actions.
| Hook | Parameters | Description |
|---|---|---|
notifal/toast/type | string $type | Toast type (success, error, etc.) |
notifal/toast/message | string $message | Toast message before query string storage |
Action: notifal/toast/dispatched (final message, type, redirect URL) , documented in Admin UI Extension.
Campaign settings (filter)
| Hook | Parameters | Description |
|---|---|---|
notifal/campaign/settings | array $settings | Campaign settings before use or storage |
Campaign save/status actions are in Notifications and Eligibility.
What to read next
Hooks series
- Hook Reference Hub
- Hooks: Lifecycle and Bootstrap (you are here)
- Hooks: Notifications and Eligibility
- Hooks: Templates and Rendering
- Hooks: Tags and Dynamic Data
- Hooks: Display Rules and Content Source
- Hooks: Analytics and Tracking
- Hooks: Admin UI Extension
- Hooks: Pro Integration Bridge