Forums

usermeta plugin help... (2 posts)

  1. aloncarmel
    Member
    Posted 6 years ago #

    Hey ,
    I got a small issue .
    I'm trying to create a function that uses the usermeta plugin hack ,

    $usermeta->set($user_ID, "usertable", $ratevalue);

    All works fine , it creates the usertable and fills it with the $ratevalue value... But it fills the user_id field with the current logged user that clicked the button , I want it to fill the user_id with the POST AUTHOR id and not the current logged user .

    I have tried using the get_author_id or author_id with no success .

    Anyone got an answer ?

  2. Austin Matzko
    Member
    Posted 6 years ago #

    $post = get_post(2); //where 2 is the post id
    then to get the author id and put it in the $author variable:
    $author = $post->post_author;

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.