Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How to hide CPT Links from profile view

@leog371

Participant

Just to be sure of what your asking, Are you trying to hide these from everyone including the person who owns the profile?

Just in case you dont want to hide them from the profile owner, you should know that any links that are edit, upload rtmedia links only display for the profile owner and no one else and most other things like this are hidden by default from users and friends anyways. Only a profile owner can upload and make changes to his profile or post activity on their profiles.

Also, each member has privacy options in their profile settings. You can set defaults in the dashboard for this as well.

If this is not the case, could you clarify what you hope to achieve?

If you simply wish to remove links for everyone in your site including the profile owner, just use something like this in bp-custom.php file

/* Example to Remove subnav tabs from Group Settings  https://codex.buddypress.org/developer/navigation-api/#examples*/ 	
	function remove_group_manager_subnav_tabs() {   
    // site admin will see all tabs
    if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) {
        return;
    }
       // all subnav items are listed here.
       // comment those you want to show
        $hide_tabs = array(             
        //  'group-settings'    => 1,
        //    'delete-group'      => 1,
         //   'group-avatar'      => 1,
        //  'group-invites'     => 1,
         //   'manage-members'    => 1,
        //  'forum'             => 1,
        //  'group-cover-image' => 1
        );
                   
        $parent_nav_slug = bp_get_current_group_slug() . '_manage';
  
    //Remove the nav items
    foreach ( array_keys( $hide_tabs ) as $tab ) {
        bp_core_remove_subnav_item( $parent_nav_slug, $tab, 'groups' );
    }   
}
add_action( 'bp_actions', 'remove_group_manager_subnav_tabs' );
Skip to toolbar