mirror of https://github.com/jlelse/GoBlog
Fix hook trigger
This commit is contained in:
parent
caf21a07fd
commit
9e6a5fd90b
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue