Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: profile_menu doesnt work on all pages

@lordcoder

Member

Ok the problem is solved by using this function instead of the default profile_menu :

function profile_menu() {

global $bb, $bbdb, $bb_current_user, $user_id, $profile_menu, $self, $profile_page_title, $bb_table_prefix;

$user_id=(isset($user_id)) ? $user_id : $bb_current_user->ID;

$list = "<ul id='profile-menu'>";

$list .= "nt<li" . ( ( $self ) ? '' : ' class="current"' ) . '><a href="' . get_user_profile_link( $user_id ) . '">' . __('Profile') . '</a></li>';

if ( isset( $profile_menu ) ) :

foreach ($profile_menu as $item) {

// 0 = name, 1 = users cap, 2 = others cap, 3 = file

$class = '';

if ( $item[3] == $self ) {

$class = ' class="current"';

$profile_page_title = $item[0];

}

if ( can_access_tab( $item, $bb_current_user->ID, $user_id ) )

if ( file_exists($item[3]) || function_exists($item[3]) )

$list .= "nt<li$class><a href='" . wp_specialchars( get_profile_tab_link($user_id, $item[0]) ) . "'>{$item[0]}</a></li>";

}

endif;

$list .= "n</ul>";

echo $list;

}

Skip to toolbar