New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Hide Upper Right Menu at top bar #4081

    Hi Dandy,

    Please try the following code. I have created role using WP Role Editor and test.

    
    function buddydev_remove_unwanted_menu() {
    
        global $wp_admin_bar;
    
        $user   = wp_get_current_user();
        $remove = false;
    
        // teacher, principal your role id
        if ( in_array( 'teacher', (array) $user->roles ) ) {
            $remove = true;
        } elseif ( in_array( 'principal', (array) $user->roles ) ) {
            $remove = true;
        }
    
        if ( $remove ) {
    
            $node_ids = array(
                'my-account-xprofile-edit',
                'my-account-xprofile-change-avatar',
                'my-account-xprofile-change-cover-image'
            );
    
            foreach( $node_ids as $id ) {
                $wp_admin_bar->remove_node( $id );
            }
    
        }
    
    }
    add_action( 'wp_before_admin_bar_render', 'buddydev_remove_unwanted_menu' );
    
    

    Let me know if It is working for you or not.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BP Groups Suggestions #4077

    Hi Christian,

    Sure, I will looking into and will update you by Monday.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Lightbox #4076

    Hi Phillippe,

    File location is in WordPress Plugin directory ‘mediapress/assets/css/mpp-core.css’. In this file you need to modify the following class

    
    .mpp-lightbox-content
    .mpp-lightbox-media-container
    .mpp-lightbox-activity-container
    
    

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Lightbox #4071

    Hi Philippe,

    Welcome to the BuddyDev. You can enlarge the lightbox width and height by modifying css.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Hide Upper Right Menu at top bar #4070

    Hi Dandy,

    Thank you for the acknowledgement that You are using User Role Editor to create user role teacher or principal. I thought teacher and principal are BuddyPress Member type. I will post here the new code.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Hide Upper Right Menu at top bar #4061

    Hi Dandy,

    There is problem with your code ‘current_user_can’ is a WordPress function and works only with WordPress Roles and Capabilities. Please try the following code

    
    
    function buddydev_remove_unwanted_menu() {
    
    	if( ! is_user_logged_in() || ! function_exists( 'buddypress' ) ) {
    		return;
    	}
    
    	global $wp_admin_bar;
    
    	$is_teacher = bp_has_member_type( bp_loggedin_user_id(), 'teacher' );
    	$is_principal = bp_has_member_type( bp_loggedin_user_id(), 'principal' );
    
    	if ( $is_teacher || $is_principal ) {
    		// place the node id you want to hide
    		$node_ids = array(
    			'my-account-xprofile-edit',
    			'my-account-xprofile-change-avatar',
    			'my-account-xprofile-change-cover-image'
    		);
    
    		foreach( $node_ids as $id ) {
    			$wp_admin_bar->remove_node( $id );
    		}
    	}
    
    }
    add_action( 'wp_before_admin_bar_render', 'buddydev_remove_unwanted_menu' );
    
    
    • This reply was modified 10 years, 4 months ago by Ravi.
    • This reply was modified 10 years, 4 months ago by Ravi.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Hide Upper Right Menu at top bar #4059

    Hi Dandy,

    Can You please share the code block that you are using?. I have tested this code on my local server and It is working for me.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Hide Upper Right Menu at top bar #4056

    Hi Dandy,

    Yes, it can be done to hide and show these items based on user role or capabilities. Please take a look the following url for WordPress User role and capability.

    https://codex.wordpress.org/Roles_and_Capabilities

    
    function buddydev_remove_unwanted_menu() {
    
        global $wp_admin_bar;
    	
    	/**
    	 * 
    	 *  either you can pass the capability or the user role like
    	 *  current_user_can('edit_posts') with user capability
    	 *  current_user_can('author') with user role
    	 * 
    	**/
    	
    	if ( current_user_can('edit_posts') ) { 
    		// place the node id you want to hide
    		$node_ids = array(
    			'my-account-xprofile-edit',
    			'my-account-xprofile-change-avatar',
    			'my-account-xprofile-change-cover-image'
    		);
    
    		foreach( $node_ids as $id ) {
    			$wp_admin_bar->remove_node( $id );
    		}
    	}
    	
    }
    add_action( 'wp_before_admin_bar_render', 'buddydev_remove_unwanted_menu' );
    
    

    Please let me know if it works for you or not.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BuddyPress Extended User Groups Widget #4052

    Hi Tammy,

    I have fixed this issue. Please download the latest code from the following url

    https://github.com/buddydev/bp-extended-user-groups-widget

    and Let me know if it works for you or not.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hi Christian,

    No Worries, We have already tested.

    Thank You
    Ravi