Skip to content

Instantly share code, notes, and snippets.

@modemlooper
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modemlooper/0dc904a89fefb79bf6bd to your computer and use it in GitHub Desktop.
Save modemlooper/0dc904a89fefb79bf6bd to your computer and use it in GitHub Desktop.
Linking to BP profiles in WP templates
When linking to BP content it's best to use BP functions. This method is good because it shows somebody else that it's BP content that the link is going to.
bp_loggedin_user_domain() // url to logged in user profile
bp_loggedin_user_username()
bp_loggedin_user_id()
bp_displayed_user_username() // use displayed for when you are on a profile instead of loggedin
or you can use this to display a complete anchor link to logged in user
bp_core_get_userlink( bp_loggedin_user_id() )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment