Plugin/API (add_action(‘publish_post’)
-
Maybe someone can help me here…
I have a plugin which I’ve setup using the Plugin API as follows:
add_action('publish_post', 'send_notification', 5);
But I’m having a problem…every time a post is published AND edited, the function runs (thus in this case, sending out an e-mail every time). It needs to only be ran the first time a post is published.
Looking at the API [https://wiki.www.ads-software.com/Plugin/API] it states thatpublish_post
is “called when a post status is changed from anything to publish or when a post is published for the first time.”
From what I’m seeing it should more accurately read, “publish_post
is called when a post status is publish or when a post is published for the first time.”
Does anyone know if this is a correct assessment of how it works? Or am I missing something?
- The topic ‘Plugin/API (add_action(‘publish_post’)’ is closed to new replies.