Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Link to profile (4 posts)

Started 1 year, 9 months ago by: boah123

  • Profile picture of boah123 boah123 said 1 year, 9 months ago:

    Hi,

    I want to make a shortcut to the current logged-in users’ profile. For example, ‘visit my profile’.
    How can I make that hyperlink? What’s the code to retriew the users’ name and url of profile?

    Thanks!

  • Profile picture of Paul Gibbs Paul Gibbs said 1 year, 9 months ago:

    Try bp_loggedinuser_link() for now

  • Profile picture of boah123 boah123 said 1 year, 9 months ago:

    Thank you, this works for now… I tried a google search to figure out if it is possible to edit the link text; I want to publish the text ‘edit profile’ and not the actual profile name. Unfortunately, google does not know.

    If you know, please let me know. ;)

  • Profile picture of outolumo outolumo said 1 year, 8 months ago:

    I put this in my functions.php:

    function bp_loggedin_user_profile_link() {
    global $bp;?>
    <a href=”‘. $bp->loggedin_user->domain . ‘” title=”profile”><?php _e( ‘My Profile’, ‘buddypress’ ) ?></a>
    <?php return;
    }

    You can change the link text to whatever you want, I chose to use one buddypress translates by default.

    NOTE: using bp_ prefixed functions may later cause collisions.