Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using the plugin Sidebar Login for BuddyPress which enables users to insert a login box in the sidebar which in turn produces three links: Dashboard, Profile, and Logout.

My issue is that the Profile link, links to the WordPress dashboard. I would like it to link to the actual BuddyPress profile page. Is there any way I can change something in sidebar-login.php or admin.php to remedy this problem?

I have pasted sidebar-login.php here: http://pastebin.com/V2v1t4gm

I have pasted admin.php here: http://pastebin.com/6KjxeZ3h

share|improve this question

closed as off-topic by kaiser Aug 4 at 14:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

    
I believe the answer is here: $links = do_shortcode( trim( get_option( 'sidebarlogin_logged_in_links' ) ) );. But without having the same setup as yours, it's impossible to tell what that do_shortcode does, and what options are inside that sidebarlogin_logged_in_links... –  brasofilo Nov 17 '12 at 11:24

1 Answer 1

up vote 2 down vote accepted

There are two ways to do that:

From the plugin settings page

On the "Loggedin Links" option, the second anchor tag is pointing to Wordpress profile by default: '<a href="http://yoursite.com/wp-admin/profile.php">Profile</a>'. You have to update this to point to Buddypress profile page, to do so, you need to know what is the members domain that Buddypress is using, by default it will be http://yoursite.com/members/username/, but it can be different if you have chosen another page to display the members directory from Buddypress settings Settings -> Buddypress -> Pages. To be sure just visit your profile and copy the browser URL, and then paste it in the href attribute of the Profile anchor tag, and then replace your username with %USERNAME% so that the anchor will become:

<a href="http://yoursite.com/members/%USERNAME%/">Profile</a>

Just edit this according to your settings.

Edit the plugin file (not recommended)

If you wish to edit the plugin file to dynamically get the user profile page link, add the following line of code after line 96 (just before echo the logout link) on sidebar-login.php:

echo '<li class="page_item"><a href="'.bp_core_get_user_domain($user_ID).'">'.__('Profile').'</a></li>';

Make sure to remove the Profile link from the Loggedin Links field of the settings page of the plugin so that you wont have double profile links on your widget. This way is not recommended because you will loose your modifications on plugin update and you will have to re-edit the file on each update of the plugin.

share|improve this answer
1  
Thank you! I didn't even think to look in plugin settings. I am a dunce. –  Desi Nov 17 '12 at 22:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.