Skip to:
Content
Pages
Categories
Search
Top
Bottom

User id on profile page

  • @opajaap

    Participant

    I am the developer of plugin wp-photo-album-plus.

    A user asked me how to show a users albums on the profile page.
    To display something in my plugin one has to add a shortcode.
    In this shortcode one can specify what to be seen, example:
    [wppa type=”covers” albums=”#owner,johndoe”] shows the covers of the albums created by johndoe.
    To make it usable for the current user, there is albums=”#owner,#me”

    I now want to implement something like albums=”#owner,#bpuser” to be used on the bp profile page, where #bpuser should be replaced by the login name of the user whos profile page is displayed.

    So what i need ia a function or a global var or a class where i can identify the user on the profile page. Eiter login name or id will suit me.

    So, the question is: How do i find the user of the profile page i am looking at??

Viewing 4 replies - 1 through 4 (of 4 total)
  • @sbrajesh

    Participant

    Hi,
    On the user profile you can use

    
    $user_id = bp_displayed_user_id();
    

    to get the user id of the currently displayed user.
    Same way, you can get username by

    
    
    $username = bp_get_displayed_user_username()
    

    Hope that helps.

    Regards
    Brajesh

    @opajaap

    Participant

    Thanx, that will do!

    @opajaap

    Participant

    @sbrajesh
    Works! User whp asked it is satisfied. Thanx a lot. Call closed.

    @sbrajesh

    Participant

    Hi @opajaap,
    You are welcome. I am glad to be of service.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘User id on profile page’ is closed to new replies.
Skip to toolbar