From: Evan Prodromou Date: Sat, 18 Dec 2010 07:39:44 +0000 (-0500) Subject: delete bookmark stuff when deleting notice X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6b7931bcc86accf00c8ff2b2ea7657d27b290f10;p=quix0rs-gnu-social.git delete bookmark stuff when deleting notice --- diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index a3067a9eb1..2137d0c225 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -76,6 +76,17 @@ class BookmarkPlugin extends Plugin return true; } + function onNoticeDeleteRelated($notice) + { + $nb = Notice_bookmark::staticGet('notice_id', $notice->id); + + if (!empty($nb)) { + $nb->delete(); + } + + return true; + } + /** * Load related modules when needed *