How can I get who approved post for publishing, in single.php? (4 posts)

  1. christopheran
    Posted 3 years ago #

    This seems like a rather basic thing that any site with multiple editors would need, but I can't find it anywhere, in codex or via plugins.

    In my single.php code, I need to get the user id of the user that approved the post - ie: changed it from 'pending' to 'publish'.

    As the admin, I need to know who to hold responsible for that action, and I want to credit them a percentage of the adshare, and perhaps even have an 'approved by' under the article.

    I don't need to have who last revised the post, because either I or the author might update it again later. I need the user that actually published it.

    Does anyone know how I get that?



  2. christopheran
    Posted 3 years ago #

    If there isn't anything like this now, how difficult would it be to write a plugin for it - I guess there would be a way to grab the transition and user at the time, and put that in the db?

  3. cdukes
    Posted 3 years ago #

    One way I think you could do this would be:
    -On post publish,
    -If custom field 'authorizer' is blank
    -Get the modified author
    -And add him to custom field 'authorizer'

  4. christopheran
    Posted 3 years ago #

    Hi Cooper,

    Thank you for your suggestion.

    I had the idea to add it to an existing plugin I was using, Peter's Collaboration Emails. It had some code already triggered when an approval/publish took place, so we just fiddled with the code there.

    Couldn't do it on my own though, got help at EE, here's the solution we came up with:


    Thanks again!


Topic Closed

This topic has been closed to new replies.

About this Topic