bp_get_group_has_avatar( int|bool $group_id = false )

Return whether a group has an avatar.


Parameters Parameters

$group_id

(int|bool) (Optional) Group ID to check.

Default value: false


Top ↑

Return Return

(boolean)


Source Source

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

function bp_get_group_has_avatar( $group_id = false ) {

	if ( false === $group_id ) {
		$group_id = bp_get_current_group_id();
	}

	$avatar_args = array(
		'item_id' => $group_id,
		'object'  => 'group',
		'no_grav' => true,
		'html'    => false,
		'type'    => 'thumb',
	);

	$group_avatar = bp_core_fetch_avatar( $avatar_args );

	if ( bp_core_avatar_default( 'local', $avatar_args ) === $group_avatar ) {
		return false;
	}

	return true;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.