BuddyDev

Search

[Resolved] Slight Issue With BuddyPress Member Types Pro

  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #50235
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24622
    Brajesh Singh on #50251
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #50269
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #50319

    Hello Casper,

    Try the following code and let me know if it helps or not.

    
    add_filter( 'bp_core_fetch_avatar_no_grav', function ( $no_grav, $params ) {
    
    	if ( 'user' !== $params['object'] ) {
    		return $no_grav;
    	}
    
    	$user_member_types = (array) bp_get_member_type( $params['item_id'], false );
            
            // Replace with your member types.
    	$mtypes_with_default_avatars = array( 'student', 'teacher' );
    
    	if ( array_intersect( $mtypes_with_default_avatars, $user_member_types ) ) {
    		return true;
    	}
    
    	return false;
    }, 15, 2 );
    
    

    Please give it a try.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #50342
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #50347
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #50370
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #50385
    This reply has been marked as private.

The topic ‘ [Resolved] Slight Issue With BuddyPress Member Types Pro’ is closed to new replies.

This topic is: resolved