• I’ve been using a plugin which uses “publish_post” to send an e-mail to the post author when the post is published. Unfortunately, this means it also sends an e-mail to the author any time his published post is updated. Is there any way to avoid this? I’d just like it to send an e-mail only on the initial publishing of the post.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ebedgert

    (@ebedgert)

    OK, I went back and looked through some old posts and the Codex like you’re supposed to ??

    I did find a solution here to the first problem, but I have kind of an unusual second problem. I am using another plugin that allows me to define custom post statuses other than “Draft” or “Pending.” These custom post statuses are important for me to retain, so I can’t drop them. Unfortunately, when I use the three alternate hooks mentioned in the thread I’ve linked to, they don’t recognize my custom statuses, and the e-mail send does not get triggered.

    Instead of

    add_action('draft_to_publish','function_name');

    I need something like

    add_action('readytopublish_to_publish','function_name');

    (“Ready to Publish” is the name of one of my custom statuses)

    Any way around this problem?

    I also had issue with my plugin Twitter Goodies.

    I figure out that issue by putting 2 different conditions. Please check out here: https://arpitshah.com/publish_post-how-to-check-if-wp-post-is-newly-published-or-edited/

    I hope it will help you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Publish_post … any way to modify?’ is closed to new replies.