These hooks cover Notifal templates (the visual designs notifications use): admin UI, HTML Builder, Elementor widgets, preview routes, import/export, and frontend HTML processing including class placeholders.
Index: Hook Reference Hub. Architecture: Architecture Overview.
Template lifecycle (actions)
| Hook | Parameters | Description |
|---|
notifal/template/created | int $template_id | New template created via admin |
notifal/template/duplicated | int $original_id, int $new_id | Template duplicated |
notifal/template/trashed | int $template_id | Template moved to trash |
notifal/template/deleted | int $template_id, string $status | Template permanently deleted |
notifal/template/trash_emptied | int[] $deleted_ids | Template trash emptied |
notifal/post/duplicated | int $newPostId, int $originalPostId, string $postType | Generic post duplication (templates and notifications) |
Template creation UI (actions)
| Hook | Parameters | Description |
|---|
notifal/template/creation/before | bool $is_modal | Before template creation view |
notifal/template/creation/after | bool $is_modal | After template creation view |
notifal/admin_page/templates/before | none | Before Templates admin page |
notifal/admin_page/templates/after | none | After Templates admin page |
Template preview (actions and filters)
| Hook | Type | Parameters | Description |
|---|
notifal/template/preview/before | action | WP_Post $post | Before iframe template preview |
notifal/template/preview/after | action | WP_Post $post | After iframe template preview |
notifal/template/preview/output | filter | string $content, WP_Post $post | Final preview HTML |
Template queries and AJAX (actions and filters)
| Hook | Type | Parameters | Description |
|---|
notifal/templates/queried_by_builder | action | string $builder, WP_Post[] $templates | After templates fetched by builder type |
notifal/templates/load_more/before | action | none | Before AJAX load-more |
notifal/templates/load_more/after | action | none | After AJAX load-more |
notifal/templates/filter/before | action | none | Before AJAX template filter |
notifal/templates/filter/after | action | none | After AJAX template filter |
notifal/templates/load_more/response | filter | array $response | Load-more AJAX response payload |
notifal/templates/filter/response | filter | array $response | Filter AJAX response payload |
notifal/templates/builder/count | filter | int $count, string $builder | Count by builder before return |
notifal/templates/total_count | filter | int $total | Total template count |
notifal/templates/builder/query_args | filter | array $args, string $builder | Query args for builder count |
notifal/templates/builder/meta_query | filter | array $metaQuery, string $builder | Meta query for builder queries |
Template titles (filters)
| Hook | Parameters | Description |
|---|
notifal/template/default_title | string $title | Default title for new templates |
notifal/template/final_title | string $title, int $post_id | Final title after creation |
Import and export (filters)
| Hook | Parameters | Description |
|---|
notifal/export/template_data | array $data | Export JSON before download |
notifal/template/import/result | array $result, string $filePath | Import result after processing |
notifal/template/import/post_status | string $status, array $template_data | Post status for imported template (default publish) |
HTML Builder (actions and filters)
| Hook | Type | Parameters | Description |
|---|
notifal/template/html_builder/assets/before | action | none | Before HTML Builder admin assets |
notifal/template/html_builder/assets/after | action | none | After HTML Builder admin assets |
notifal/template/html_builder/save/before | action | int $templateId, string $title, string $html | Before AJAX save |
notifal/template/html_builder/saved | action | int $templateId | After successful AJAX save |
notifal/template/html/sanitize/before | filter | string $html | Raw HTML before sanitization |
notifal/template/html/sanitize/after | filter | string $html, string[] $warnings | Sanitized HTML and warnings |
notifal/template/html/kses/allowed | filter | array $allowed | Allowed tags for restricted saves |
notifal/template/html_builder/widgets | filter | array $widgets | HTML Builder widget palette definitions and AI snippets |
notifal/template/html_builder/use_cases | filter | array $options | AI prompt use case options for JS |
notifal/template/html_builder/display_layouts | filter | array $options | AI prompt layout options for JS |
notifal/template/html_builder/ai_prompt_examples | filter | array $examples | AI field-filling pattern examples |
notifal/template/html_builder/primary_color | filter | string $color | Default brand color for HTML Builder AI |
Use FilterHooks::TEMPLATE_HTML_BUILDER_WIDGETS for widget registration. Each row requires id, label, category, category_label, icon, description, default_html, and ai_snippet.
Complete example: Cookbook: Register a Custom HTML Builder Widget.
Elementor integration (actions and filters)
| Hook | Type | Parameters | Description |
|---|
notifal/elementor/widgets/registered | action | none | After all Notifal Elementor widgets registered |
notifal/elementor/widget/{slug}/before | action | \Elementor\Widget_Base $widget | Before widget render (dynamic slug) |
notifal/elementor/widget/{slug}/after | action | \Elementor\Widget_Base $widget | After widget render (dynamic slug) |
notifal/elementor/random_product/data | filter | array $data | Product data before ProductImageWidget render |
Use sprintf(ActionHooks::ELEMENTOR_WIDGET_RENDER_BEFORE, $widget_slug) for dynamic hook names.
Frontend rendering (actions and filters)
| Hook | Type | Parameters | Description |
|---|
notifal/template_renderer/shortcode_context | action | WP_Post $template | Shortcode/bootstrap context for REST/AJAX render |
notifal/onpage/template/class_placeholders/before | filter | string $html, array $frontendContext | HTML before class-placeholder processing |
notifal/onpage/template/class_placeholders/after | filter | string $html, array $frontendContext | HTML after class-placeholder processing |
Class placeholders power features like analytics click tracking classes on custom elements. See Analytics and Tracking (notifal/onpage/analytics/track_click_class).
Templates admin assets (actions)
| Hook | Parameters | Description |
|---|
notifal/templates/admin/assets/before | none | Before templates admin assets enqueue |
notifal/templates/admin/assets/after | none | After templates admin assets enqueue |
WooCommerce product data (filter)
Used when templates resolve random or pool-based product tags.
| Hook | Parameters | Description |
|---|
notifal/woocommerce/product/random | array $products | Random WooCommerce product fetch result |
Product DTO and tag hooks: Tags and Dynamic Data.
Image size options (filter)
| Hook | Parameters | Description |
|---|
notifal/image_size/dropdown_options | array $options | Image size dropdown in admin |
What to read next
Hooks series
- Hook Reference Hub
- Hooks: Lifecycle and Bootstrap
- Hooks: Notifications and Eligibility
- Hooks: Templates and Rendering (you are here)
- Hooks: Tags and Dynamic Data
- Hooks: Display Rules and Content Source
- Hooks: Analytics and Tracking
- Hooks: Admin UI Extension
- Hooks: Pro Integration Bridge