Clanbite General Since 1.5.0

apply_filters( 'clanbite_toast_config', array<string, mixed> $browser_config, array<string, mixed> $settings )

Filters the configuration object sent to the browser as window.clanbiteToastConfig.

This is the last word before the page prints: use it to change any value (including the i18n strings) or to pass your own keys to a script that reads the config.

Filter PHP

Parameters

$browser_config (array<string, mixed>)

enabled, position, positions (allowed slugs), duration (ms, 0 = until closed), max, pauseOnHover, showTimer, i18n.

$settings (array<string, mixed>)

The validated settings from clanbite_get_toast_settings().

Example

add_filter( 'clanbite_toast_config', function ( $browser_config, $settings ) {
	// Change $browser_config here.
	return $browser_config;
}, 10, 2 );

Defined in inc/toasts.php

Changelog

VersionDescription
1.5.0Introduced.