WordPress.org

Ready to get started?Download WordPress

Forums

Fire plugin function only when post/page is *first* published? (1 post)

  1. harknell
    Member
    Posted 4 years ago #

    Hi, from what I can see the hook publish_page is fired whenever a page is published, or also if a page is updated. I don't suppose there's a hook that *only* occurs when a page is initially created? I believe there's a hook to fire when a page is edited, so I'm wondering why publish_page actually also fires when a page is edited later....seems sort of wrong. I only want a function in a plugin I'm writing to happen upon initial creation of a page, not when it's later edited.

    Of course I could write up a query to see if it's in the database and blah, blah.... But It seems to me a hook that occurs only at initial publish of a page would be a nice addition to things (unless I'm missing it, please let me know)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.