Notifications
36 hooks fired by Notifications: 27 filters and 9 actions across 37 call sites.
36 hooks fired by Notifications: 27 filters and 9 actions across 37 call sites. 31 of the 37 call sites are described by a docblock, at the call or on the constant that names the hook; the rest are listed with their signature and call sites only. Paths are relative to the plugin directory.
wp_react_settings_shared_context_initial_values
Filter · 1 argument · 1 call site
Filters the shared context given to controls on the Notifications settings pages.
applyFilters( 'wp_react_settings_shared_context_initial_values', {} )initialValues(Object) — Shared context values. Default empty object.
Fired from:
assets/packages/notifications/admin/screens/Settings.js:198
xpac-notifications-template-panels
Filter · 1 argument · 1 call site
The JS filter a plugin adds its template panel on: { name, title, meta, component }.
applyFilters( 'xpac-notifications-template-panels', [] )Fired from:
assets/packages/notifications/editor/usePanels.js:20
xpac_agent_changed
Action · 4 arguments · 1 call site
Fires when a tool call changed something XPAC Agent cannot record by itself.
do_action( 'xpac_agent_changed', self::HANDLER, self::OBJECT . $type, ['type' => $type, 'switches' => $before], sprintf( __('Switches of "%s"', '{XPAC}'), (string) (Api::definition($type)['label'] ?? $type) ) )$handler(string) —xpac-notifications/types.$object(string) —xpac-notifications/type:<type>.$before(array) —{type, switches}, the type's switches before the write, null when none were stored.$label(string) — The change, named for a person.
Fired from:
packages/Notifications/Abilities/Undo.php:53
xpac_agent_tool_enabled
Filter · 2 arguments · 1 call site
Filters whether one XPAC tool may register as an ability. XPAC Agent answers from its switches.
apply_filters( 'xpac_agent_tool_enabled', false, self::NAMESPACE . '/' . $name )$enabled(bool) — Default false.$name(string) — The full ability name, such asxpac-notifications/list-types.
Fired from:
packages/Notifications/Abilities/Abilities.php:109
xpac_notifications_abilities
Filter · 1 argument · 1 call site
Filters which Notifications abilities are registered for AI agents.
Names are the part after xpac-notifications/, such as list-types. One left out is not registered.
apply_filters( 'xpac_notifications_abilities', $allowed )$abilities(string[]) — Ability names. Default the ones XPAC Agent's switches allow.
Fired from:
packages/Notifications/Abilities/Abilities.php:121
xpac_notifications_bell_config
Filter · 2 arguments · 1 call site
Filters the nav badges the bell keeps current for a user.
apply_filters( 'xpac_notifications_bell_config', ['badges' => []], $userId )$config(array{badges: array<int, array<string, mixed>>}) — Badges with id, count, route, channel, selector, attribute, className and max.$userId(int) — The user.
Fired from:
packages/Notifications/Blocks/NotificationsDropdown.php:127
xpac_notifications_block_emails
Filter · 1 argument · 1 call site
Filters whether notification emails are edited in the block editor and rendered by it.
Off, there is no template editor and every email is rendered from the PHP templates.
apply_filters( self::FILTER, true )$on(bool) — Whether the block editor is used.
Fired from:
packages/Notifications/Templates/Adapter.php:387
xpac_notifications_channels
Filter · 4 arguments · 1 call site
Filters the channels one user gets a notification on, after the type's and the user's own choices.
A channel can only be turned off here. Asked before a notification is stored, with both channels, and again before its email goes out, with email alone, since the user may have changed in between. User Profiles turns email off for an account that still has to verify its address, except for the account notices themselves.
apply_filters( self::CHANNELS, $channels, $userId, $type, $data )$channels(array<string, bool>) — The channels being decided: onsite and email, or email alone.$userId(int) — User id.$type(string) — Notification type.$data(array<string, mixed>) — Data the templates read.
Fired from:
packages/Notifications/Core/Sender.php:348
xpac_notifications_delivery_policy
Filter · 2 arguments · 1 call site
Filters the retry, pause and retention rules a notification channel is delivered by.
apply_filters( 'xpac_notifications_delivery_policy', $policy, $channel )$policy(Policy) — The rules: attempts, waits, codes, pause threshold, lease, run budget and days kept.$channel(string) — Channel id, such as email or webhook; '' for the defaults.
Fired from:
packages/Notifications/Deliveries/Service.php:106
xpac_notifications_email
Filter · 5 arguments · 1 call site
Filters whether a provider sent one notification email; a provider that sends it returns true.
apply_filters( self::EMAIL_FILTER, false, $to, $subject, $html, $settings )$sent(bool) — Whether it went out so far.$to(string) — Recipient address.$subject(string) — Subject.$html(string) — HTML body.$settings(array<string, mixed>) — The type's onsite and email switches, as filtered by xpac_notifications_email_settings, plus headers, text, delivery_id and messageVariables.
Fired from:
packages/Notifications/Api.php:151
xpac_notifications_email_message
Filter · 2 arguments · 1 call site
Filters a notification email after it is rendered and before it is sent.
apply_filters( 'xpac_notifications_email_message', $message, $this )$message(EmailMessage) — The email.$delivery(NoticeDelivery) — The delivery it is for.
Fired from:
packages/Notifications/Deliveries/NoticeDelivery.php:221
xpac_notifications_email_settings
Filter · 3 arguments · 1 call site
Filters the settings one notification email is sent with.
apply_filters( 'xpac_notifications_email_settings', $settings, $type, $data )$settings(array<string, mixed>) — The type's settings.$type(string) — Notification type.$data(array<string, mixed>) — Data the template reads.
Fired from:
packages/Notifications/Deliveries/EmailChannel.php:160
xpac_notifications_email_variables
Filter · 3 arguments · 1 call site
Filters the variables a type's email template gets.
apply_filters( self::VARIABLES_FILTER, [], $type, $data )$variables(array<string, mixed>) — Variables.$type(string) — Notification type.$data(array<string, mixed>) — The notification's payload.
Fired from:
packages/Notifications/Templates/Renderer.php:160
xpac_notifications_emailed
Action · 4 arguments · 1 call site
Fires after a notification was emailed: as plain email, or through a provider such as SendGrid.
do_action( 'xpac_notifications_emailed', (int) $row['subject_id'], (int) $row['user_id'], (string) $row['topic'], (string) $row['channel'] )$notificationId(int) — Notice id, or 0 for an email about no stored notice.$userId(int) — User id.$type(string) — Notification type.$channel(string) — The channel id, such as email or sendgrid.
Fired from:
packages/Notifications/Deliveries/Service.php:166
xpac_notifications_fanout_batch
Action · 3 arguments · 1 call site
Fires after each batch of a fan-out job.
do_action( 'xpac_notifications_fanout_batch', $source, $key, $stats )$source(string) — Source, such as messaging.$key(string) — Key, such as thread:12.$stats(array<string, int>) — recipients, stored, skipped, queries and ms of the batch.
Fired from:
packages/Notifications/Core/Fanout.php:308
xpac_notifications_init
Action · 0 arguments · 1 call site
Fires when Notifications is ready to be extended.
Runs on init at priority 200, after the types and the delivery channels registered.
do_action( self::INIT_ACTION )Fired from:
packages/Notifications/Bootstrap.php:193
xpac_notifications_paused_email
Filter · 2 arguments · 1 call site
Filters whether the site admin is emailed when a notification channel pauses.
The Deliveries screen shows the pause either way.
apply_filters( 'xpac_notifications_paused_email', true, $scope )$send(bool) — Whether to send the email. Default true.$scope(string) — The scope that paused, such as email or webhook:<endpoint id>.
Fired from:
packages/Notifications/Deliveries/Notices.php:90
xpac_notifications_read
Action · 3 arguments · 1 call site
Fires after notifications were marked as read: one, all of some types, or those of a grouping key.
do_action( 'xpac_notifications_read', $ids, $userId, $types )$ids(int[]) — Rows marked; empty when every unread row of the types was.$userId(int) — User id.$types(string[]) — Types; empty for every type.
Fired from:
packages/Notifications/Core/Storage.php:296
xpac_notifications_register
Action · 1 argument · 1 call site
Fires once, on init 105, for the notifiers to add their types.
A Notifier built after this attaches at once, so a late one is never lost.
do_action( self::ACTION_REGISTER, $this->getComponent(self::MANAGER) )$manager(Core\Manager) — The registry of the types.
Fired from:
packages/Notifications/Bootstrap.php:182
xpac_notifications_register_deliveries
Action · 1 argument · 1 call site
Fires once, on init 106, for packages to add the channels notifications can go out through.
do_action( self::ACTION_REGISTER, self::$registry )$registry(Registry) — The registry of channels.
Fired from:
packages/Notifications/Deliveries/Service.php:78
xpac_notifications_remove_data_on_uninstall
Filter · 1 argument · 1 call site
Filters whether uninstalling Notifications deletes the notices, deliveries, templates and choices.
apply_filters( 'xpac_notifications_remove_data_on_uninstall', false )$remove(bool) — Whether to delete them. Default false.
Fired from:
packages/Notifications/Bootstrap.php:121
xpac_notifications_retention_months
Filter · 1 argument · 1 call site
Filters how many months a notice is kept before the daily cleanup deletes it.
apply_filters( 'xpac_notifications_retention_months', self::RETENTION_MONTHS )$months(int) — Months, at least one.
Fired from:
packages/Notifications/Core/Cron.php:121
xpac_notifications_settings_fields
Filter · 2 arguments · 1 call site
Filters the settings sections of one notifier before they land on their Notifications pages.
apply_filters( 'xpac_notifications_settings_fields', array_values($sections), $this )$sections(array<int, array<string, mixed>>) — Settings sections.$notifier(Notifier) — The notifier they belong to.
Fired from:
packages/Notifications/Notifier.php:208
xpac_notifications_should_send
Filter · 4 arguments · 1 call site
Filters whether one user gets a notification at all, before it is stored.
Runs again before each delivery of a stored one, so a user suspended in between gets no email either.
apply_filters( self::SHOULD_SEND, true, $userId, $type, $data )$send(bool) — Whether to send it.$userId(int) — User id.$type(string) — Notification type.$data(array<string, mixed>) — Data the templates read.
Fired from:
packages/Notifications/Core/Sender.php:375
xpac_notifications_stored
Action · 5 arguments · 1 call site
Fires after a notification row was written for a user.
do_action( self::STORED_ACTION, $id, $userId, $type, $data, $how )$id(int) — Row id.$userId(int) — User id.$type(string) — Notification type.$data(array<string, mixed>) — The data the row stores.$how(string) — created, bumped, revived, refreshed or kept.
Fired from:
packages/Notifications/Core/Sender.php:394
xpac_notifications_template_editor_assets
Action · 2 arguments · 1 call site
Fires on a notification template's editor screen once its assets are queued.
A plugin queues the script that adds its panel on the xpac-notifications-template-panels JS filter.
do_action( self::ASSETS_ACTION, $type, $post->ID )$type(string) — The template's notification type.$postId(int) — The template post id.
Fired from:
packages/Notifications/Templates/Editor.php:429
xpac_notifications_template_file
Filter · 3 arguments · 1 call site
Filters the template file a notice renders with, over the theme's copy and the plugin's own.
apply_filters( self::FILTER, $path, $type, $channel )$path(string) — Absolute path of the template.$type(string) — Notification type, or 'email' for the email layout.$channel(string) — onsite or email, or 'layout' for the email layout.
Fired from:
packages/Notifications/Core/Template.php:63
xpac_notifications_template_tag_groups
Filter · 2 arguments · 1 call site
Filters the groups of tags a type's template offers besides its own, such as a user's profile fields.
A group is {id, label, tags} and each tag {name, label, sample, html}: its name (a letter, then
letters, digits, _ or -), its label, optional, the value a preview shows when it has none, and
whether its value is HTML (phrasing content only). Values come on xpac_notifications_template_values.
apply_filters( self::GROUPS_FILTER, [], $type )$groups(array<int, array<string, mixed>>) — Groups.$type(string) — Notification type.
Fired from:
packages/Notifications/Templates/Tags.php:231
xpac_notifications_template_tags
Filter · 2 arguments · 1 call site
Filters the tags a type's email template offers in the editor.
apply_filters( self::TAGS_FILTER, $tags, $type )$tags(array<string, array{label: string, category: string, html: bool}>) — Tag by name.$type(string) — Notification type.
Fired from:
packages/Notifications/Templates/Tags.php:188
xpac_notifications_template_values
Filter · 5 arguments · 1 call site
Filters the values of a type's tags for one recipient, such as the tags of its tag groups.
Values are plain text and are escaped where they go. The common values are laid over these afterwards, and a value that is not a scalar is left out.
apply_filters( self::VALUES_FILTER, $values, $type, $data, $userId, $row )$values(array<string, mixed>) — Value by tag name: the type's own so far.$type(string) — Notification type.$data(array<string, mixed>) — The notice's data.$recipientId(int) — Recipient.$row(array<string, mixed>) — The stored notice, when there is one.
Fired from:
packages/Notifications/Templates/Context.php:58
xpac_notifications_{$type}_url
Filter · Dynamic name · 3 arguments · 1 call site
Filters where a notification of one type links to.
apply_filters( "xpac_notifications_{$type}_url", $url, $data, $userId )$url(string|false) — The link, or false for none.$data(array<string, mixed>) — The notification's payload.$userId(int) — The user it is for.
Fired from:
packages/Notifications/Core/Links.php:41
xpac_realtime_available
Filter · 1 argument · 1 call site
apply_filters( 'xpac_realtime_available', false )Fired from:
packages/Notifications/Core/RealtimeChannels.php:58
xpac_realtime_client_config
Filter · 3 arguments · 1 call site
apply_filters( 'xpac_realtime_client_config', [], self::NOTIFICATIONS, ['user_id' => $userId] )Fired from:
packages/Notifications/Core/RealtimeChannels.php:141
xpac_realtime_polling_interval
Filter · 1 argument · 1 call site
apply_filters( 'xpac_realtime_polling_interval', self::POLL_SECONDS )Fired from:
packages/Notifications/Core/RealtimeChannels.php:122
xpac_realtime_publish_many
Filter · 4 arguments · 1 call site
apply_filters( 'xpac_realtime_publish_many', 0, self::NOTIFICATIONS, $paramSets, $payload )Fired from:
packages/Notifications/Core/RealtimeChannels.php:79
xpac_realtime_transport
Filter · 1 argument · 2 call sites
apply_filters( 'xpac_realtime_transport', 'polling' )Fired from:
packages/Notifications/Core/RealtimeChannels.php:99packages/Notifications/Core/RealtimeChannels.php:140