开发者

update facebook status on publish_post and not when post is updated in wordpress

开发者 https://www.devze.com 2023-03-16 20:38 出处:网络
I have created a wordpress plugin which updates my facebook status when a new post is publi开发者_开发技巧shed. But the problem is that it also updates my facebook status if I updates a post after edi

I have created a wordpress plugin which updates my facebook status when a new post is publi开发者_开发技巧shed. But the problem is that it also updates my facebook status if I updates a post after editing it even though the post has already been published. How do I solve this issue.


Instead of running the trigger on publish_post, have it run on new_to_publish, draft_to_publish, and future_to_publish. Those three triggers run when a new post is added, when a draft post is published, and when a scheduled post is published.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号