Reply To: Better access to our bbpress profile page

Home Forums Support Better access to our bbpress profile page Reply To: Better access to our bbpress profile page

#204847
Max

Tom

The following snippet will add a “profile” link to the top right of the nav menu for anyone that is logged in:


add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
function my_nav_menu_profile_link($menu) { 	
	if (!is_user_logged_in())
		return $menu;
	else
		$current_user = wp_get_current_user();
		$user=$current_user->user_login ;
		$profilelink = '<li><a href="http://localhost/forum/forums/users/' . $user . '/edit">My Profile</a></li>';
		$menu = $menu . $profilelink;
		return $menu;
}

Kind Regards

Max