Skip to:
Content
Pages
Categories
Search
Top
Bottom

Link to profile

  • Avatar of boah123
    boah123
    Participant

    @boah123

    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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    Try bp_loggedinuser_link() for now

    Avatar of boah123
    boah123
    Participant

    @boah123

    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. ;)

    Avatar of outolumo
    outolumo
    Participant

    @outolumo

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.