Skip to content

Commit c6aa5dc

Browse files
Merge branch 'release/9.0.5'
2 parents 9066dd7 + eccdbd0 commit c6aa5dc

File tree

7 files changed

+23
-38
lines changed

7 files changed

+23
-38
lines changed

compat/register-hooks.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
add_action('notification/settings/register', [$this->component('BracketSpace\Notification\Admin\Settings'), 'carriersSettings'], 30, 1);
3636
add_action('notification/settings/register', [$this->component('BracketSpace\Notification\Admin\Settings'), 'emailsSettings'], 40, 1);
3737
add_filter('notification/settings/triggers/valid_post_types', [$this->component('BracketSpace\Notification\Admin\Settings'), 'filterPostTypes'], 10, 1);
38+
add_filter('wp_kses_allowed_html', [$this->component('BracketSpace\Notification\Admin\Settings'), 'filterAllowedDescriptionHtml'], 10, 2);
3839
add_filter('post_row_actions', [$this->component('BracketSpace\Notification\Admin\NotificationDuplicator'), 'addDuplicateRowAction'], 50, 2);
3940
add_action('admin_post_notification_duplicate', [$this->component('BracketSpace\Notification\Admin\NotificationDuplicator'), 'notificationDuplicate'], 10, 0);
4041
add_action('init', [$this->component('BracketSpace\Notification\Admin\PostType'), 'register'], 10, 0);
@@ -110,3 +111,8 @@
110111
add_action('rest_api_init', [$this->component('BracketSpace\Notification\Api\Api'), 'restApiInit'], 10, 0);
111112
add_action('admin_notices', [$this->component('BracketSpace\Notification\Compat\WebhookCompat'), 'displayNotice'], 10, 0);
112113
add_action('admin_notices', [$this->component('BracketSpace\Notification\Compat\RestApiCompat'), 'testRestApi'], 10, 0);
114+
add_filter('notification/from/json', [$this->component('BracketSpace\Notification\Repository\Converter\JsonConverter'), 'from'], 10, 1);
115+
add_filter('notification/to/json', [$this->component('BracketSpace\Notification\Repository\Converter\JsonConverter'), 'to'], 10, 2);
116+
add_filter('notification/from/array', [$this->component('BracketSpace\Notification\Repository\Converter\ArrayConverter'), 'from'], 10, 1);
117+
add_filter('notification/to/array', [$this->component('BracketSpace\Notification\Repository\Converter\ArrayConverter'), 'to'], 10, 2);
118+
add_filter('notification/carrier/form/data/values', [$this->component('BracketSpace\Notification\Repository\Carrier\Email'), 'allowUnfilteredHtmlBody'], 10, 2);

notification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Description: Customisable email and webhook notifications with powerful developer friendly API for custom triggers and notifications. Send alerts easily.
55
* Author: BracketSpace
66
* Author URI: https://bracketspace.com
7-
* Version: 9.0.4
7+
* Version: 9.0.5
88
* Requires PHP: 7.4
99
* Requires at least: 5.8
1010
* License: GPL3

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: notification, bracketspace, Kubitomakita, tomaszadamowicz, insejn,
33
Tags: notification, notify, alert, email, mail, webhook, API, developer, framework
44
Requires at least: 4.9
55
Tested up to: 6.6
6-
Stable tag: 9.0.4
6+
Stable tag: 9.0.5
77
Requires PHP: 7.4
88
License: GPLv3
99
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -297,8 +297,12 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo
297297

298298
== Changelog ==
299299

300+
= 9.0.5 =
301+
* [Fixed] Dochooks compatibility file has been updated.
302+
300303
= 9.0.4 =
301304
* [Fixed] Fix issues with invalid JSON of Notification in wp_posts table.
305+
* [Fixed] Duplicate email prevention not working for custom post types.
302306

303307
= 9.0.3 =
304308
* [Fixed] No license activated in v8 being displayed in the admin.

src/Integration/WordPressIntegration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function loadDatabaseNotifications()
4949
/**
5050
* Prevents the duplicate notifications
5151
*
52-
* Gutenberg or other editors, especiallyu when used within other
52+
* Gutenberg or other editors, especially when used within other
5353
* plugins which manipulate the data.
5454
*
5555
* @filter notification/background_processing/trigger_key
@@ -63,7 +63,7 @@ public function identifyTrigger($triggerKey, Triggerable $trigger)
6363
{
6464
$coveredTriggers = [
6565
'BracketSpace\Notification\Repository\Trigger\Post\PostTrigger' => static function ($trigger) {
66-
return $trigger->{$trigger->getPostType()}->ID;
66+
return $trigger->post->ID;
6767
},
6868
'BracketSpace\Notification\Repository\Trigger\User\UserTrigger' => static function ($trigger) {
6969
return $trigger->userId;

src/Repository/CarrierRepository.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
use BracketSpace\Notification\Defaults\Carrier\Webhook;
1414
use BracketSpace\Notification\Defaults\Carrier\WebhookJson;
1515
use BracketSpace\Notification\Register;
16-
use BracketSpace\Notification\Dependencies\Micropackage\DocHooks\Helper as DocHooksHelper;
17-
1816
/**
1917
* Carrier Repository.
2018
*/
@@ -26,7 +24,7 @@ class CarrierRepository
2624
public static function register()
2725
{
2826
if (\Notification::settings()->getSetting('carriers/email/enable')) {
29-
Register::carrier(DocHooksHelper::hook(new Carrier\Email()));
27+
Register::carrier(\Notification::component(Carrier\Email::class));
3028
}
3129

3230
if (
@@ -36,7 +34,7 @@ public static function register()
3634
return;
3735
}
3836

39-
Register::carrier(DocHooksHelper::hook(new Webhook('Webhook')));
40-
Register::carrier(DocHooksHelper::hook(new WebhookJson('Webhook JSON')));
37+
Register::carrier(new Webhook('Webhook'));
38+
Register::carrier(new WebhookJson('Webhook JSON'));
4139
}
4240
}

src/Repository/ConverterRepository.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/Runtime.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ public function singletons()
274274
$this->addComponent(new Api\Api());
275275
$this->addComponent(new Compat\WebhookCompat());
276276
$this->addComponent(new Compat\RestApiCompat());
277+
278+
$this->addComponent(new Repository\Converter\JsonConverter());
279+
$this->addComponent(new Repository\Converter\ArrayConverter());
280+
281+
// Defaults
282+
$this->addComponent(new Repository\Carrier\Email());
277283
}
278284

279285
/**
@@ -313,15 +319,13 @@ public function defaults()
313319
'carriers',
314320
'recipients',
315321
'triggers',
316-
'converters',
317322
],
318323
[
319324
Repository\GlobalMergeTagRepository::class,
320325
Repository\ResolverRepository::class,
321326
Repository\CarrierRepository::class,
322327
Repository\RecipientRepository::class,
323328
Repository\TriggerRepository::class,
324-
Repository\ConverterRepository::class,
325329
]
326330
);
327331
}

0 commit comments

Comments
 (0)