bp_get_group_creator_avatar

Return the avatar of the creator of the current group in the loop.

Description

(string) bp_get_group_creator_avatar( (constant) $group = false, (array) $args = array() ); 

Returns (string)

Parameters (2)

0. $group — Optional. (constant) => false
Group object. Default: current group in loop.
1. $args — Optional. (array) => array()
The args.

Options

    ;        


    Usage

    1. if ( !function_exists( 'bp_get_group_creator_avatar' ) ) { 
    2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
    3.  
    4. // Optional. Group object. 
    5. // Default: current group in loop. 
    6. $group = false; 
    7.  
    8. // The args. 
    9. $args = array(); 
    10.  
    11. // NOTICE! Understand what this does before running. 
    12. $result = bp_get_group_creator_avatar($group, $args); 
    13.  

    Defined (1)

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

    /bp-groups/bp-groups-template.php  
    1. function bp_get_group_creator_avatar( $group = false, $args = array() ) { 
    2. global $groups_template; 
    3.  
    4. if ( empty( $group ) ) { 
    5. $group =& $groups_template->group; 
    6.  
    7. $defaults = array( 
    8. 'type' => 'full',  
    9. 'width' => false,  
    10. 'height' => false,  
    11. 'class' => 'avatar',  
    12. 'id' => false,  
    13. 'alt' => sprintf( __( 'Group creator profile photo of %s', buddypress ), bp_core_get_user_displayname( $group->creator_id ) ) 
    14. ); 
    15.  
    16. $r = wp_parse_args( $args, $defaults ); 
    17. extract( $r, EXTR_SKIP ); 
    18.  
    19. $avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) ); 
    20.  
    21. /** 
    22. * Filters the avatar of the creator of the current group in the loop. 
    23. * @since 1.7.0 
    24. * @since 2.5.0 Added the `$group` parameter. 
    25. * @param string $avatar Avatar of the group creator. 
    26. * @param object $group Group object. 
    27. */ 
    28. return apply_filters( 'bp_get_group_creator_avatar', $avatar, $group );