Skip to:
Content
Pages
Categories
Search
Top
Bottom

Calling currently displayed user

  • @frpsh

    Member

    I want to call the currently displayed user’s username in my code.
    I need to grab this username completely devoid of styling/spaces so that I can use it to call stuff from a database.
    What’s the best way to do this? `bp_displayed_user_username();` hasn’t seemed to work with the database.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @chrisclayton

    Participant

    bp_displayed_user_username() is a wrapper function that echo’s the username.
    If you want to use it to “call stuff from a database”, i think you need to use the following (which will return the username rather than echo it.

    bp_get_displayed_user_username();

    @frpsh

    Member

    Thank you so much! That’s just what I needed to get it working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Calling currently displayed user’ is closed to new replies.
Skip to toolbar