Skip to content

Commit 851d5dd

Browse files
committed
feat: add notification and trigger parameters to background processing delay filter
Enhance the notification/background_processing/delay filter by providing $notification and $trigger parameters for better context when filtering delay time. This allows developers to implement more sophisticated delay logic based on notification type and trigger context.
1 parent 870bce6 commit 851d5dd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo
297297

298298
== Changelog ==
299299

300+
= [Next] =
301+
* [Changed] Added $notification and $trigger parameters to notification/background_processing/delay filter for better context when filtering delay time.
302+
300303
= 9.0.6 =
301304
* [Added] "Refresh All Licenses" button in Extensions page to manually check all extension license statuses from the store.
302305
* [Changed] Updated package.json files to support Node.js 22 compatibility with explicit engine requirements.

src/Core/Processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static function schedule(Notification $notification, Triggerable $trigger
9191
self::getCache($triggerKey)->set($trigger);
9292

9393
$result = wp_schedule_single_event(
94-
time() + apply_filters('notification/background_processing/delay', 30),
94+
time() + apply_filters('notification/background_processing/delay', 30, $notification, $trigger),
9595
'notification_background_processing',
9696
[
9797
$notification->to('json', ['jsonOptions' => JSON_UNESCAPED_UNICODE]),

0 commit comments

Comments
 (0)