Support » Plugins » Hacks » Duplicating actions behind Submit button

  • Resolved TIEro


    Is there a list somewhere of all the actions that pressing the “Submit for Review” button kicks off? Or a simple way to call the same set of functions?

    I’d like to present a “Submit” option in a custom posts list, you see. I can do it with php/MySQL if I have to, but I figured it’d be more elegant if there’s a WP function that does the same thing.

    Tried searching the Codex, but…


Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz


    Not that I know of, but I haven’t had reason to look for one either. I suspect you will fire all the actions that matter simply by using wp_insert_post(). If you notice something not happening I suppose you’d have to go looking for it, but I really doubt it will be necessary.

    As it happens, I just stumbled across wp_update_post(), which seems to be in the same family, and thence wp_publish_post().

    wp_insert_post() looks like a more complete process (with sanitised data and so on) and, since I only want to do a status update, I suspect you’re right – anything missing would be unusual.

    Thanks very much: I’ll give the insert function a run. 🙂

    Addendum: had to use wp_update_post(). I have no idea why wp_insert_post() didn’t work (with the same parameters), but the update version does everything I expected!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicating actions behind Submit button’ is closed to new replies.