bp_get_group_creator_avatar( object|bool $group = false, array $args = array() )
Return the avatar of the creator of the current group in the loop.
Description
Parameters
- $group
-
(Optional) Group object. Default: current group in loop.
Default value: false
- $args
-
(Optional) Array of optional arguments. See bp_core_fetch_avatar() for detailed description of arguments.
- 'type'
(string) Default: 'full'. - 'width'
(int) Default: false. - 'height'
(int) Default: false. - 'class'
(int) Default: 'avatar'. - 'id'
(string) Passed to 'css_id'. Default: false. - 'alt'
(string) Alt text. Default: 'Group creator profile photo of [user display name]'.
Default value: array()
- 'type'
Return
(string)
Source
File: bp-groups/bp-groups-template.php
function bp_get_group_creator_avatar( $group = false, $args = array() ) {
global $groups_template;
if ( empty( $group ) ) {
$group =& $groups_template->group;
}
$r = bp_parse_args( $args, array(
'type' => 'full',
'width' => false,
'height' => false,
'class' => 'avatar',
'id' => false,
'alt' => sprintf( __( 'Group organizer profile photo of %s', 'buddyboss' ), bp_core_get_user_displayname( $group->creator_id ) )
), 'group_creator_avatar' );
extract( $r, EXTR_SKIP );
$avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) );
/**
* Filters the avatar of the creator of the current group in the loop.
*
* @since BuddyPress 1.7.0
* @since BuddyPress 2.5.0 Added the `$group` parameter.
*
* @param string $avatar Avatar of the group creator.
* @param object $group Group object.
*/
return apply_filters( 'bp_get_group_creator_avatar', $avatar, $group );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 1.7.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.