Clanbite JavaScript Since 1.5.0

wp.hooks.applyFilters( 'clanbite.toasts.settings', Object settings, Object options )

Filters the site-wide popup settings for one toast, after the server's values are applied.

Use it to change the defaults for particular toasts (for example a longer time for one source). Settings an extension passes to show() itself still win over these.

Filter JavaScript

Parameters

$settings (Object)

enabled, position, duration (ms, 0 = until closed), max (toasts per corner), timer (countdown bar), pauseOnHover.

$options (Object)

The options passed to clanbite.toasts.show().

Example

wp.hooks.addFilter( 'clanbite.toasts.settings', 'my-plugin/handler', function ( settings, options ) {
	return settings;
} );

Defined in assets/js/clanbite-toasts.js

Changelog

VersionDescription
1.5.0Introduced.