Developer documentation
To extend HurryTimer functionalities, different WordPress hooks and Javascript events are added to the plugin.

Hooks

do_action('hurrytimer_init');
Fires after HurryTimer has finished loading .
do_action( "hurryt{campaign_id}_campaign_ended", HurryTimer\Campaign $campaign);Fires after one-time or recurring timer has reached zero.
$campaign: The (HurryTimer\Campaign) instance
apply_filters('hurryt_show_campaign', bool $can_show);
Filters whether to show the campaign.
$can_show: (bool) Whether the campaign should be shown.
apply_filters('sticky_bar_hide_timeout', int $delay);
Filters how long to wait before reopening a dismissed sticky bar.
$delay: (int) Number of days. Default 7.

Javascript Events

hurryt:finished: Fires after timer has reached zero.
Example:
1
$('.hurrytimer-campaign').on('hurryt:finished', function(event, campaign){
2
// campaign.id: the campaign ID
3
// campaign.mode: one_time, recurring, or evergreen.
4
});
Copied!
Last modified 1yr ago
Copy link