bp_get_group_cover_url( object|bool $group = false )

Returns the group cover image URL.

Description

Parameters

$group

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

Default value: false

Return

(string) The cover image URL or empty string if not found.

Source

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

function bp_get_group_cover_url( $group = false ) {
	$group_id = bp_get_group_id( $group );

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

	$cover_url = bp_attachments_get_attachment(
		'url',
		array(
			'object_dir' => 'groups',
			'item_id'    => $group_id,
		)
	);

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

	return $cover_url;
}

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.