bp_get_group_avatar_url( object|bool $group = false, string $type = 'full' )

Returns the group avatar URL.

Description

Parameters

$group

(Optional) Group object. Default current group in loop.

Default value: false

$type

(Optional) The type of the avatar ('full' or 'thumb'). Default 'full'.

Default value: 'full'

Return

(string) The avatar URL.

Source

File: bp-groups/bp-groups-template.php

function bp_get_group_avatar_url( $group = false, $type = 'full' ) {
	$group_id = bp_get_group_id( $group );

	if ( ! $group_id ) {
		return '';
	}

	return bp_core_fetch_avatar(
		array(
			'type'    => $type,
			'object'  => 'group',
			'item_id' => $group_id,
			'html'    => false,
		)
	);
}

Changelog

Changelog
Version Description
BuddyPress 5.0.0 BuddyPress 5.0.0
BuddyBoss 1.3.5 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.