Notifications
Clear all

wpForo 1.x.x [Closed] Hide "Recent Posts" tab if not logged in

2 Posts
2 Users
0 Reactions
1,632 Views
Posts: 5
Topic starter
(@webdevguy)
Active Member
Joined: 7 years ago

If a user is not logged in, how can I HIDE the default "Recent Posts" tab?

Β 

Β 

1 Reply
Sofy
Posts: 5450
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

HiΒ webdevguy,

I'm sorry, but there is no any option for this purpose.Β  You need to use the following code (put the code ithe n current active themeΒ functions.phpΒ file):

function mycustom_wpforo_menu_array_filter($menu){
if( !is_user_logged_in() ){
unset( $menu['wpforo-recent'] );
}
return $menu;
}
add_filter('wpforo_menu_array_filter', 'mycustom_wpforo_menu_array_filter');