Skip to content

Commit

Permalink
chore: keep notifiction data in wp_posts table
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmikita committed Oct 3, 2024
1 parent 9fc0a21 commit 179a7f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo

== Changelog ==

= [Next] =
* [Changed] Notification data is now kept in the wp_posts table for easier reverting to previous version.

= 9.0.0 =

**Compatibility Breaking Changes**
Expand Down
5 changes: 4 additions & 1 deletion src/Database/NotificationDatabaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ public static function upsert(Notification $notification)
'ID' => $post === null ? 0 : $post->ID,
'post_title' => $notification->getTitle(),
'post_name' => $notification->getHash(),
'post_content' => '',
/**
* @todo Remove backward compatibility content save.
*/
'post_content' => $notification->to('json'),
'post_status' => $notification->isEnabled() ? 'publish' : 'draft',
'post_type' => 'notification',
]
Expand Down

0 comments on commit 179a7f9

Please sign in to comment.