Search code examples
wordpressbuddypressavatar

Create a "Change Avatar" button with buddypress


I'm trying to find the code within the buddypress plugin that links directly to the "Change Profile Photo" page of the user that is logged in. I'm sure this requires php but I can not find it anywhere.

This way I can add link/button on the home page of my site that says "Change Your Avatar!" and it will go to that section of the users profile. Thanks


Solution

  • The following link should work: http://example.com/members/MEMBERNAME/profile/change-avatar/ The "MEMBERNAME" is the username of a user. To get the url for a users profile you can use bp_loggedin_user_domain(). Adding the following to the top of your site will show a link to allow the users change their profile image.

    <a href="<?php echo bp_loggedin_user_domain() ?>profile/change-avatar/">Change Your Avatar!</a>