Fix hook trigger

This commit is contained in:
Jan-Lukas Else 2021-07-14 16:15:24 +02:00
parent caf21a07fd
commit 9e6a5fd90b
1 changed files with 2 additions and 2 deletions

View File

@ -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)