bp_get_new_group_avatar

Return the avatar for the group currently being created.

Description

(string) bp_get_new_group_avatar( (string) $args = '' ); 

Returns (string)

The avatar for the group being created

Parameters (1)

0. $args — Optional. (string) => ''
The args.

Options

    ;        


    Usage

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

    Defined (1)

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

    /bp-groups/bp-groups-template.php  
    1. function bp_get_new_group_avatar( $args = '' ) { 
    2.  
    3. // Parse arguments. 
    4. $r = bp_parse_args( $args, array( 
    5. 'type' => 'full',  
    6. 'width' => false,  
    7. 'height' => false,  
    8. 'class' => 'avatar',  
    9. 'id' => 'avatar-crop-preview',  
    10. 'alt' => __( 'Group photo', buddypress ),  
    11. ), 'get_new_group_avatar' ); 
    12.  
    13. // Merge parsed arguments with object specific data. 
    14. $r = array_merge( $r, array( 
    15. 'item_id' => bp_get_current_group_id(),  
    16. 'object' => 'group',  
    17. 'avatar_dir' => 'group-avatars',  
    18. ) ); 
    19.  
    20. // Get the avatar. 
    21. $avatar = bp_core_fetch_avatar( $r ); 
    22.  
    23. /** 
    24. * Filters the new group avatar. 
    25. * @since 1.1.0 
    26. * @param string $avatar HTML markup for the new group avatar. 
    27. * @param array $r Array of parsed arguments for the group avatar. 
    28. * @param array $args Array of original arguments passed to the function. 
    29. */ 
    30. return apply_filters( 'bp_get_new_group_avatar', $avatar, $r, $args );