Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25494

    Hi Slim,
    Welcome back to BuddyDev.

    Are you sure they are coming from profile tabs and linking to BuddyPress user profile tabs?

    Can you please show me your tab settings(did you specify admin bar id) for the same?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25494
    Brajesh Singh on in reply to: How to hide group settings tab? #24555

    Hi Matthew,
    Please add the following lines too

    
    
    /**
     * Remove group admin/settings sub nav.
     */
    function buddydev_remove_group_admin_settings() {
    
    	if ( ! bp_is_group() ) {
    		return;
    	}
    
    	bp_core_remove_subnav_item( groups_get_current_group()->slug . '_manage', 'group-settings', 'groups' );
    
    	// reattach screen function to avoid 404.
    	add_action( 'bp_screens', 'groups_screen_group_admin', 3 );
    }
    
    add_action( 'bp_template_redirect', 'buddydev_remove_group_admin_settings', 1 );
    

    That will remove the settings from manage too.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25494
    Brajesh Singh on in reply to: [Resolved] buddypress multisite not working #24552

    Marking resolved due to lack of activity.

  • Keymaster
    (BuddyDev Team)
    Posts: 25494

    Marking resolved due to lack of activity.

  • Keymaster
    (BuddyDev Team)
    Posts: 25494

    Closing as resolved due to lack of activity and the age of the ticket.

  • Keymaster
    (BuddyDev Team)
    Posts: 25494
    Brajesh Singh on in reply to: moving/deleting/renaming tabs and subnavs #24546

    Hi Gijs,
    Thank you for the patience.
    Achieving what you are looking for can be divided into 3 parts:-

    1. Adding new tabs under profile and removing it from settings
    2. setting up action handler to handle the form submission
    3. template loading for settings and modifying form urls to point to the new url.

    You will need some custom code and a few template page editing. I will explain below.

    1. Custom code:- Please put this in your bp-custom.php

    
    
    /**
     * When we are on profile component,
     * If someone asks it is settings component, say yes. This is not the best strategy but helps remove remove the action handler barrier.
     */
    add_filter( 'bp_is_current_component', function ( $is_current_component, $component ) {
    	if ( 'settings' == $component && bp_is_current_component( 'profile' ) ) {
    		$is_current_component = true;
    	}
    
    	return $is_current_component;
    }, 10, 2 )
    
    /**
     * Add some of the settings sub nav as xprofile sub nav.
     */
    function buddydev_custom_setup_xprofile_settings_nav() {
    // Determine user to use.
    	if ( bp_displayed_user_domain() ) {
    		$user_domain = bp_displayed_user_domain();
    	} elseif ( bp_loggedin_user_domain() ) {
    		$user_domain = bp_loggedin_user_domain();
    	} else {
    		return;
    	}
    	$access        = bp_core_can_edit_settings();
    	$slug          = bp_get_profile_slug();
    	$settings_link = trailingslashit( $user_domain . $slug );
    	$sub_nav       = array();
    	$sub_nav []    = array(
    		'name'            => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ),
    		'slug'            => 'profile',
    		'parent_url'      => $settings_link,
    		'parent_slug'     => $slug,
    		'screen_function' => 'bp_xprofile_screen_settings',
    		'position'        => 110,
    		'user_has_access' => bp_core_can_edit_settings()
    	);
    	$sub_nav[]     = array(
    		'name'            => __( 'Export Data', 'buddypress' ),
    		'slug'            => 'data',
    		'parent_url'      => $settings_link,
    		'parent_slug'     => $slug,
    		'screen_function' => 'bp_settings_screen_data',
    		'position'        => 120,
    		'user_has_access' => $access,
    	);
    
    	$sub_nav[] = array(
    		'name'            => __( 'Delete Account', 'buddypress' ),
    		'slug'            => 'delete-account',
    		'parent_url'      => $settings_link,
    		'parent_slug'     => $slug,
    		'screen_function' => 'bp_settings_screen_delete_account',
    		'position'        => 130,
    		'user_has_access' => ! is_super_admin( bp_displayed_user_id() )
    	);
    
    	foreach ( $sub_nav as $su ) {
    		bp_core_new_subnav_item( $su, 'members' );
    	}
    }
    
    /**
     * After settings nav is registered, let us reorganize.
     */
    function buddydev_custom_reorganize_settings_nav() {
    	bp_core_remove_subnav_item('settings', 'delete-account');
    	bp_core_remove_subnav_item('settings', 'data');
    	bp_core_remove_subnav_item('settings', 'profile');
    	buddydev_custom_setup_xprofile_settings_nav();
    }
    add_action( 'bp_settings_setup_nav', 'buddydev_custom_reorganize_settings_nav', 300 );
    
    

    That is part 1. You will need to edit the profile templates to include the settings form and will also need to update the settings template to submit to profile page.

    here is the code I added in my profile template(switch part)

    
    	case 'delete-account':
    		bp_get_template_part( 'members/single/settings/delete-account' );
    		break;
    
    	case 'profile':
    		bp_get_template_part( 'members/single/settings/profile' );
    		break;
    
    	case 'data':
    		bp_get_template_part( 'members/single/settings/data' );
    		break;
    

    I hope you can take it from here.

    If you are not comfortable with editing php files, please consider our customization service

    https://buddydev.com/buddypress-plugin-customization-service/

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25494

    Thank you. Will do.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25494
    Brajesh Singh on in reply to: moving/deleting/renaming tabs and subnavs #24540
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25494
    Brajesh Singh on in reply to: How to hide group settings tab? #24539

    Hi Matthew,
    Welcome to BuddyDev forums.

    The tabs creators pro allows you to add any tab/sub tab. It allows removing top level tabs from group but not from group creation.

    You can use the following code to remove th settings tab from group creation.

    
    /**
     * Remove group settings from group creation.
     */
    add_filter( 'groups_create_group_steps', function ( $steps ) {
    	unset( $steps['group-settings'] );
    
    	return $steps;
    } );
    
    

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25494
    Brajesh Singh on in reply to: moving/deleting/renaming tabs and subnavs #24535

    Hi Gijs,
    Thank you for the purchase.

    1. Have issued refund for the Group Tabs Pro. It is included with your purchase of Profile Tabs pro too.

    2. Yes, it is possible to move settings by copying code. Please let me know which sub tab you want to move). It will be easier to move from settings to profile.

    Regards
    Brajesh