WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. christopheran
    Member
    Posted 1 year 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?

    Thanks,

    Chris

  2. christopheran
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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:

    http://www.experts-exchange.com/Web_Development/Blogs/WordPress/Q_27887997.html

    Thanks again!

    Chris

Topic Closed

This topic has been closed to new replies.

About this Topic