Clanbite JavaScript Since 1.5.0

wp.hooks.applyFilters( 'clanbite.toasts.shouldShow', boolean show, Object payload )

Filters whether a toast is shown. Return false to suppress it.

Filter JavaScript

Parameters

$show (boolean)

Default true.

$payload (Object)

Normalised toast options (see clanbite.toasts.payload).

Example

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

Defined in assets/js/clanbite-toasts.js

Changelog

VersionDescription
1.5.0Introduced.