Untested (I am overworked at the moment), but in
wp-content/plugins/bbp-style-pack/includes/function.php
try changing lines 88 – 111 to
/**********BSP LOGIN*******************/
/**********adds login/logout to menu*******************/
if ($bsp_login['add_login'] == true ) {
add_filter( 'wp_nav_menu_items', 'bsp_nav_menu_login_link', 10, 2 );
}
function bsp_nav_menu_login_link($menu, $args) {
if( $args->theme_location == 'primary' ) {
global $bsp_login ;
if ($bsp_login['only_bbpress'] == true ) {
if(is_bbpress()) {
$loginlink = bsp_login() ;
}
else {
$loginlink="" ;
}
}
else {
$loginlink = bsp_login();
}
$menu = $menu . $loginlink ;
}
return $menu;
}
If that works, come back and I’ll give you then register part.
If it doesn’t, then I got the code from
http://wordpress.stackexchange.com/questions/2143/customizing-only-a-specific-menu-using-the-wp-nav-menu-items-hook
so take a look at that
Hope you can work it out !
Let me know either way !
Oh, this removed all the logout buttons, also from the main menu
I’ll have a look later on, busy till later next week so no rush.
I noticed the theme location primary in the code, After checking I had to change it as the Theme had changed it for to something else for the primary (Don’t know why)..but this solved the problem, Thanks
Great – glad you’re fixed !
Could you point out what to do for the register link, I could’t figure that one out, probebly the same concept, but I couldn’t get is to work.
Kind regards,
Martijn
Try
if ($bsp_login['register'] == true ) {
add_filter( 'wp_nav_menu_items', 'bsp_register', 10, 2 );
}
function bsp_register ($menu, $args) {
if( $args->theme_location == 'primary' ) {
global $bsp_login ;
if (is_user_logged_in())
return $menu;
else
$url = $bsp_login['Register PageRegister page'] ;
if (!empty($bsp_login['Register PageMenu Item Description'] )) {
$desc=$bsp_login['Register PageMenu Item Description'] ;
}
else $desc=__('Register', 'bbp-style-pack') ;
$registerlink = '<li><a href="'.$url.'">'.$desc.'</a></li>';
$menu = $menu . $registerlink;
}
return $menu;
}
Let me know if this works
great – glad you’re fixed !