Clanbite Points JavaScript Since 1.3.0

wp.hooks.applyFilters( 'clanbite.points.earnedToastPayload', Object payload, Object item )

Filters the options of a "points earned" popup before it is shown.

Change the wording, icon, type or length here, or add actions. The shared clanbite.toasts.payload filter runs afterwards.

Filter JavaScript

Parameters

$payload (Object)

Toast options for clanbite.toasts.show().

$item (Object)

The award (id, action_key, points_type_key, amount, message) or, for a combined popup, the summary (points_type_key, amount, count, message).

Example

wp.hooks.addFilter( 'clanbite.points.earnedToastPayload', 'my-plugin/handler', function ( payload, item ) {
	return payload;
} );

Defined in inc/Points/earned-popup.js

Changelog

VersionDescription
1.3.0Introduced.