how can I Modify the visibility of existing profile Tab?
is it possible with BuddyPress User Profile Tabs Creator Pro?
thanksHi Slim,
At the moment you can not modify the visibility or slug of an existing menu.
Changing the visibility is feasible though.We will add it in 1.0.4(or 5), which will be available around the 3rd week of January.
For now, Here are the things you can do with the pre existing tab.
https://buddydev.com/docs/guides/plugins/buddypress-plugins/buddypress-user-profile-tabs-creator-pro/modify-existing-profile-tab/Thank you
BrajeshThanks for your reply Brajesh
I found your code in buddypress forum
add_action(‘bp_friends_setup_nav’,’bpdev_custom_hide_friends_if_not_self’); function bpdev_custom_hide_friends_if_not_self(){ if(bp_is_my_profile()|| is_super_admin()) return ; bp_core_remove_nav_item(‘friends’); }
.
it is to limit visibility to only profile owner and admin, did you think it’s still working?
can you help me with modified code to: -limit the visibility of tab to only loged in members.
-limit the visibility of tab to only freinds and admin.thanks
Hi Slim,
Here is the code that you can use to limit the visibility to User(self), friends and siteadmin/** * Remove the friends menu from user profile if visiting someone else's profile and is not friend. */ function bpdev_custom_hide_friends_if_not_self() { if ( bp_is_my_profile() || is_super_admin() || friends_check_friendship( bp_displayed_user_id(), bp_loggedin_user_id() ) ) { return; } bp_core_remove_nav_item( 'friends' ); } add_action('bp_friends_setup_nav','bpdev_custom_hide_friends_if_not_self');
The old code is still working. But the code you have posted is using encoded quotes which will cause fatal error. Need to replace
‘
with
'
or
"
Regards
BrajeshThank you for your help.
I tried your code and it’s working for me except for groups and forums.
I am trying to hide them for non logged users.
Her is my code
function bpdev_custom_hide() { // show only for those people if ( bp_is_my_profile() || is_super_admin() ) { return; } if (! is_user_logged_in()) { bp_core_remove_nav_item( 'activity' ); bp_core_remove_nav_item( 'friends' ); bp_core_remove_nav_item( 'groups' ); // not working bp_core_remove_nav_item( 'forums' ); // not working bp_core_remove_nav_item( 'articles' ); // not working } else if (! bp_is_my_profile()) { bp_core_remove_subnav_item( 'activity', 'mentions' ); bp_core_remove_subnav_item( 'activity', 'favorites' ); bp_core_remove_subnav_item( 'activity', 'friends' ); bp_core_remove_subnav_item( 'activity', 'groups' ); bp_core_remove_nav_item( 'friends' ); return; } //else if (! friends_check_friendship( bp_displayed_user_id(), bp_loggedin_user_id())) { //} } add_action('bp_friends_setup_nav','bpdev_custom_hide');
Thank you.
Hi Brajesh, BuddyPress User Profile Tabs Creator Pro plugin 1.0.2 is published, did it support friends visibility now?
Can you have a look to my programm in the previous comment please.Thanks
Hi Slim,
Please upgrade to 1.0.3
https://buddydev.com/plugins/buddypress-user-profile-tabs-creator-pro/I have added support for Friends, Followers, Following visibility level depending on whether Friends component is enabled and the BP Follow plugin is active.
Regards
BrajeshHi Brajesh
I’m waiting for the upgrade that allow the modification of the visibility of existing profile Tab. Is it coming soon?
Thanks
Hi Slim,
Sorry for the delays. We lost till 10th feb due to some issues. Please allow me to post it on 19th. Yes, It is coming and the Remove existing nav item is coming too.Thank you
BrajeshGrate thanks
I have another question is it possible to modify a tab to a sub tab with the plugin.
In fact, follower plugin adds 2 tabs to the buddypress profil, is it possible to moved this 2 tabs in one tab containing 2 sub tabs.Thanks
You must be logged in to reply to this topic.