bp_get_group_current_avatar

Returns the current group avatar.

Description

(string) bp_get_group_current_avatar( (string) $type = 'thumb' ); 

Returns (string)

$tab The current tab's slug.

Parameters (1)

0. $type — Optional. (string) => 'thumb'
Thumb or full.

Usage

  1. if ( !function_exists( 'bp_get_group_current_avatar' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
  3.  
  4. // Thumb or full. 
  5. $type = 'thumb'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_group_current_avatar($type); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-groups/bp-groups-template.php  
  1. function bp_get_group_current_avatar( $type = 'thumb' ) { 
  2.  
  3. $group_avatar = bp_core_fetch_avatar( array( 
  4. 'item_id' => bp_get_current_group_id(),  
  5. 'object' => 'group',  
  6. 'type' => $type,  
  7. 'avatar_dir' => 'group-avatars',  
  8. 'alt' => __( 'Group avatar', buddypress ),  
  9. 'class' => 'avatar' 
  10. ) ); 
  11.  
  12. /** 
  13. * Filters the current group avatar. 
  14. * @since 2.0.0 
  15. * @param string $group_avatar HTML markup for current group avatar. 
  16. */ 
  17. return apply_filters( 'bp_get_group_current_avatar', $group_avatar );