From 9e6a5fd90bd66990579829c00e48957d9d9785ae Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Wed, 14 Jul 2021 16:15:24 +0200 Subject: [PATCH] Fix hook trigger --- postsDb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postsDb.go b/postsDb.go index 84db4e6..1634e3d 100644 --- a/postsDb.go +++ b/postsDb.go @@ -131,8 +131,8 @@ func (a *goBlog) createOrReplacePost(p *post, o *postCreationOptions) error { return err } // Trigger hooks - if p.Status == statusPublished { - if o.new || o.oldStatus != statusPublished { + if p.Status == statusPublished || p.Status == statusUnlisted { + if o.new || (o.oldStatus != statusPublished && o.oldStatus != statusUnlisted) { defer a.postPostHooks(p) } else { defer a.postUpdateHooks(p)