Updating to v9
Please note, that Notification v9 is not compatible with v8 add-ons and v9 add-ons are not compatible with Notification v8. If you're upgrading, please make sure to upgrade everything at once.
Most noticeable changes
The most noticeable changes to the new version of the Notification plugin are listed below.
Custom database table
Notifications data were moved from the wp_posts
table to the custom table in the database.
The code API within didn't change, so if you've been adjusting notifications via official methods, functions, or hooks, you're covered and don't have to change anything.
Coding standards
We dropped WP Coding Standards in favor of modern PSR-12. Multiple code APIs changed, mostly from snake_case to camelCase, but for most of the functions and methods we offer a casegnostic approach, they should be backward compatible.
Webhooks carriers
Since version 9, Webhook and Webook JSON carriers are available as a paid add-on. This add-on now offers also an Incoming webhooks feature. We did this to better support this feature as a part of our business. Thank you for your understanding.
Compatibility Breaking Changes
Webook and Webhook JSON Carriers are now deprecated and won't work. Read more about that change
Notifications are now saved into the custom table instead of relying on wp_posts.
Class methods and properties has been changed from snake_case to camelCase.
In Post Triggers, dynamic property
$trigger->{$post_type}
has been replaced with static prop$trigger->post
.The same as above applies to Post Trigger datetime tags, namely: postCreationDatetime, postPublicationDatetime, and postModificationDatetime.
Post Merge Tags will now use
property_name
attribute rather thanpost_type
to set trigger property used by resolvers.Hook
notification/data/save
andnotification/data/save/after
now pass Core\Notification instance in the first param instead of the WordPress adapter instance.Runtime components are now referenced by FQCN (Fully Qualified Class Name), instead of the name.
Namespace changes
BracketSpace\Notification\Defaults\
changed toBracketSpace\Notification\Repository\
BracketSpace\Notification\Abstracts\Carrier
changed toBracketSpace\Notification\Repository\Carrier\BaseCarrier
BracketSpace\Notification\Abstracts\Field
changed toBracketSpace\Notification\Repository\Field\BaseField
BracketSpace\Notification\Abstracts\MergeTag
changed toBracketSpace\Notification\Repository\MergeTag\BaseMergeTag
BracketSpace\Notification\Abstracts\Recipient
changed toBracketSpace\Notification\Repository\Recipient\BaseRecipient
BracketSpace\Notification\Abstracts\Resolver
changed toBracketSpace\Notification\Repository\Resolver\BaseResolver
BracketSpace\Notification\Abstracts\Trigger
changed toBracketSpace\Notification\Repository\Trigger\BaseTrigger
Hook depracations
notification/data/save/after
, usenotification/data/saved
Function and method deprecations
BracketSpace\Notification\Admin\PostType::getAllNotifications()
, useBracketSpace\Notification\Database\NotificationDatabaseService::getAll()
notification_convert_data()
, useBracketSpace\Notification\Core\Notification::from('array', $array)
notification_register_settings()
, use thenotification/settings/register
action directlynotification_get_settings()
, use\Notification::component('settings')->getSettings()
notification_update_setting()
, use\Notification::component('settings')->updateSetting()
notification_get_setting()
, use\Notification::component('settings')->getSetting()
notification_adapt()
, useBracketSpace\Notification\Core\Notification::to()
notification_adapt_from()
, useBracketSpace\Notification\Core\Notification::from()
notification_swap_adapter()
, use::from()
and::to()
methods on theBracketSpace\Notification\Core\Notification
classnotification_add()
, useBracketSpace\Notification\Register::notification()
notification_log()
, useBracketSpace\Notification\Core\Debugger::log()
notification()
, useBracketSpace\Notification\Register::notificationFromArray()
Removed deprecated hooks
notitication/admin/notifications/pre
, usenotification/admin/carriers/pre
notitication/admin/notifications
, usenotification/admin/carriers
notification/email/use_html_mime
, usenotification/carrier/email/use_html_mime
notification/email/recipients
, usenotification/carrier/email/recipients
notification/email/subject
, usenotification/carrier/email/subject
notification/email/message/pre
, usenotification/carrier/email/message/pre
notification/email/message/use_autop
, usenotification/carrier/email/message/use_autop
notification/email/message
, usenotification/carrier/email/message
notification/email/headers
, usenotification/carrier/email/headers
notification/email/attachments
, usenotification/carrier/email/attachments
notification/webhook/args
, usenotification/carrier/webhook/args
notification/webhook/args/{$type}
, usenotification/carrier/webhook/args/{$type}
notification/notification/form_fields/values
, usenotification/carrier/fields/values
Last updated