bp_get_new_group_avatar( array|string $args = '' )
Return the avatar for the group currently being created
Description
See also
- bp_core_fetch_avatar(): For a description of arguments and return values.
Parameters
- $args
-
(Optional) Arguments are listed here with an explanation of their defaults. For more information about the arguments, see bp_core_fetch_avatar().
- 'alt'
(string) Default: 'Group photo'. - 'class'
(string) Default: 'avatar'. - 'type'
(string) Default: 'full'. - 'width'
(int|bool) Default: false. - 'height'
(int|bool) Default: false. - 'id'
(string) Passed to $css_id parameter. Default: 'avatar-crop-preview'.
Default value: ''
- 'alt'
Return
(string) The avatar for the group being created
Source
File: bp-groups/bp-groups-template.php
function bp_get_new_group_avatar( $args = '' ) { // Parse arguments. $r = bp_parse_args( $args, array( 'type' => 'full', 'width' => false, 'height' => false, 'class' => 'avatar', 'id' => 'avatar-crop-preview', 'alt' => __( 'Group photo', 'buddyboss' ), ), 'get_new_group_avatar' ); // Merge parsed arguments with object specific data. $r = array_merge( $r, array( 'item_id' => bp_get_current_group_id(), 'object' => 'group', 'avatar_dir' => 'group-avatars', ) ); // Get the avatar. $avatar = bp_core_fetch_avatar( $r ); /** * Filters the new group avatar. * * @since BuddyPress 1.1.0 * * @param string $avatar HTML markup for the new group avatar. * @param array $r Array of parsed arguments for the group avatar. * @param array $args Array of original arguments passed to the function. */ return apply_filters( 'bp_get_new_group_avatar', $avatar, $r, $args ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.