{"id":1320353,"date":"2009-12-24T16:35:40","date_gmt":"2009-12-24T16:35:40","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/problem-with-edit_post-and-publish_post-hooks\/"},"modified":"2016-08-19T15:03:17","modified_gmt":"2016-08-19T15:03:17","slug":"problem-with-edit_post-and-publish_post-hooks","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/problem-with-edit_post-and-publish_post-hooks\/","title":{"rendered":"problem with edit_post and publish_post hooks"},"content":{"rendered":"<p>i have following problem. i need fire specific actions whenever a post is published ord edited. therefore i use edit_post and publish_post. my problem is, that whenever i edit a published post, the publish_post action is fired too, which is because &#8216;publish post&#8217; runs when a post is published, or if it is edited and its status is &#8220;published&#8221;. but i need an action which is only to run, when the post is published not edited and status published.<\/p>\n<p>anyone ever had this problem? thx in advance<\/p>\n","protected":false},"template":"","class_list":["post-1320353","topic","type-topic","status-closed","hentry","topic-tag-action-hooks"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1320353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1320353\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1320353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}