WordPress.org

Forums

[resolved] Duplicating actions behind Submit button (4 posts)

  1. TIEro
    Member
    Posted 1 year ago #

    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...

    Thanks!

  2. bcworkz
    Member
    Posted 1 year ago #

    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.

  3. TIEro
    Member
    Posted 1 year ago #

    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. :)

  4. TIEro
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.