[wp-hackers] Plugin/API (add_action('publish_post')

Brian Groce wp at briangroce.com
Mon Jul 19 04:00:40 UTC 2004


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

[see: 
http://www.briangroce.com/archives/2004/07/word-press-email-notification-plugin-v12/]

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 [http://wiki.wordpress.org/Plugin/API] it states that 
publish_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?

Thanks,

Brian
http://briangroce.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/hackers_wordpress.org/attachments/20040718/bc916daf/attachment.htm


More information about the hackers mailing list