Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get User ID on Profile Page


  • mikebronner
    Participant

    @mikebronner

    Hi all,

    I need to get the user ID of the profile being viewed. How can I achieve this on the bbpress profile page?

    Thanks!
    ~Mike

Viewing 4 replies - 1 through 4 (of 4 total)
  • `bbp_get_user_id( 0, true, false );`


    mikebronner
    Participant

    @mikebronner

    Excellent!!! Thank you 🙂


    mikebronner
    Participant

    @mikebronner

    There seems to be a bug with this function: it returns 0 for a new user who hasn’t made a forum post yet. As soon as the user does make a post, it returns the correct ID. Is there any way to work around that, maybe initialize the user with a function call?


    perineo
    Participant

    @perineo

    How do you use this mike? I may want to print a gallery of each user in their profile, but i cant figure out how to do this. By now, this works:

    global $current_user; get_currentuserinfo();
    echo do_shortcode(‘[nggtags gallery=’. $current_user->user_login .’]’);

    but prints out the logged in user gallery, not the user of the profile page, any clue? I use tags to make the galleries for each user, I only need the name of the user profile, printed in the shortcode, 🙂 Thank you guys in advance, maybe this helps you too Mike.. gl

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar