Getting Started

Getting Started for Developers

4 min read

This guide is for WordPress developers who want to extend Notifal from a custom plugin, mu-plugin, or theme functions.php.

You do not need to fork Notifal. Use WordPress actions/filters, the REST API, and the DI container helpers documented in this module.

Requirements

RequirementNotes
WordPressSame minimum as Notifal (see plugin header)
PHP7.4+ (8.x supported)
Notifal base pluginRequired
Notifal ProOptional, for Pro-only hooks and features

Load your code on or after notifal/initialized so all core services exist.

Boot order (base plugin)

Notifal boots on WordPress init priority 0 via Notifal\Bootstrap\Plugin:

  1. Infrastructure , migrations, admin menu, shared assets (notifal/infrastructure/services filter)
  2. Tags domain , dynamic tag registry
  3. Settings domain , global settings
  4. Feature modules , auto-discovered from app/Modules/*/ServiceProvider.php
  5. notifal/initialized action fires
add_action( 'notifal/initialized', function () {
    // Safe to call notifal_app(), register hooks, REST extensions, etc.
} );

Activation and deactivation fire notifal/activated and notifal/deactivated from Maintenance.php. See Hooks: Lifecycle and Bootstrap.

Boot order (Notifal Pro)

Pro loads on plugins_loaded priority 5, then:

  1. Pro infrastructure, license, updates, Pro features provider
  2. Waits for notifal/initialized, then boots Pro modules from notifal-pro/app/Modules/*/ServiceProvider.php
  3. Fires notifal_pro/initialized

Hook Pro-specific logic after both plugins are ready:

add_action( 'notifal_pro/initialized', function () {
    // Pro modules and license gates are available.
} );

Resolving services (DI container)

Use notifal_app( ClassName::class ) to resolve shared services from Notifal's container:

use Notifal\Modules\OnPageNotification\Application\Services\Core\EligibilityService;

add_action( 'notifal/initialized', function () {
    $eligibility = notifal_app( EligibilityService::class );
} );

Pro services use notifal_pro_app() when Pro is active.

Each module registers services through AbstractServiceProvider, which:

  • Reads a $services array on the provider class
  • Applies a module-specific filter (for example notifal/onpage/services)
  • Calls register() and boot() on each service class

See Architecture Overview.

GoalStart here
Change notification payload before frontendnotifal/onpage/notification/content filter , Cookbook: Modify Notification Before Display
Register a custom dynamic tagnotifal/tag/register action , Cookbook: Add Custom Dynamic Tag
Register an HTML Builder widgetnotifal/template/html_builder/widgets filter, Cookbook: Register a Custom HTML Builder Widget
Extend hosted Notifal AI generationnotifal/ai/* filters , Hooks: Hosted Notifal AI
Adjust template import resultnotifal/template/import/result filter
Add admin fields to notification tabsnotifal/admin/onpage/{tab}/before actions
Gate or extend Pro featuresnotifal_pro_* filters , Hooks: Pro Integration Bridge
Full hook indexHook Reference Hub
REST integrationREST API Reference

Source code map

AreaPath (base plugin)
Bootstrapapp/Bootstrap/Plugin.php
Hook constantsapp/Infrastructure/WordPress/Hooks/ActionHooks.php, FilterHooks.php
DI containerapp/Core/Foundation/Container.php
Service providersapp/Modules/*/ServiceProvider.php
REST (on-page)app/Modules/OnPageNotification/Infrastructure/WordPress/Registration/ApiRegistrar.php
Tags RESTapp/Domain/Tags/Infrastructure/WordPress/Registration/

Pro mirrors the same patterns under notifal-pro/app/.

Conventions

  • Hook names use the notifal/ or notifal_pro/ prefix with slash segments.
  • PHP classes use constants in ActionHooks / FilterHooks , prefer those over hard-coded strings.
  • Sanitize all incoming data, escape output, verify nonces on admin/AJAX endpoints.
  • Do not enqueue Notifal source asset paths in production; use built files from build/ when bundling alongside Notifal.

Developers module

  1. Getting Started for Developers (you are here)
  2. Architecture Overview
  3. REST API Reference
  4. Hook Reference Hub
  5. Cookbook series