BuddyDev

Search

[Resolved] Hyperlink to edit profile

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #16496

    I use “clean login” as a plugin, it has an “edit my profile” link on its widget, but it goes to a separate page to edit the basics, I’d like to get it to go to the Buddypress edit profile page instead.

    I tried some suggestions from the Buddypress groups, but they didn’t work, the URL wasn’t the right one.

    Am sure this is easy one to work out for you guys.

    This is the line that’s currently used

    echo "<li><a href='$edit_url'>". __( 'Edit my profile', 'clean-login') ."</a></li>";

    What do I need to alter to go to the BP members edit profile?

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #16497

    Hi Audiomonk,

    You can use

    get_edit_profile_url( $user_id)
    

    to get the profile edit link.

    In your case, you can use the following code

    
    
    echo "<li><a href='" . get_edit_profile_url( get_current_user_id() ) . "'>" . __( 'Edit my profile', 'clean-login' ) . "</a></li>";
    

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #16503

    Thank you Brajesh it worked straight away, I thought that would be an easy one for you. 🙂

    As I say the information I found on the net about how to do this was incorrect, completely different from your solution.

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #16514

    You are welcome. Glad that it worked 🙂

The topic ‘ [Resolved] Hyperlink to edit profile’ is closed to new replies.

This topic is: resolved