Clanbite JavaScript

wp.hooks.applyFilters( 'clanbite.notifications.showToast', boolean handled, string message, string type )

Lets a handler show the toast itself. Return a truthy value after rendering to skip the shared popup.

Prefer the shared clanbite.toasts.* filters (for example clanbite.toasts.payload) to change how every popup looks.

Filter JavaScript

Parameters

$handled (boolean)

Default false.

$message (string)

Toast message.

$type (string)

info, success or error.

Example

wp.hooks.addFilter( 'clanbite.notifications.showToast', 'my-plugin/handler', function ( handled, message, type ) {
	return handled;
} );

Defined in src/blocks/notifications/notification-bell/view.js

Changelog

VersionDescription
1.5.0Updated.