bp_groups_default_avatar( string $avatar, array $params )

Use the mystery group avatar for groups.

Description

Parameters

$avatar

(string) (Required) Current avatar src.

$params

(array) (Required) Avatar params.

Return

(string)

Source

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

function bp_groups_default_avatar( $avatar, $params ) {
	if ( isset( $params['object'] ) && 'group' === $params['object'] ) {
		if ( isset( $params['type'] ) && 'thumb' === $params['type'] ) {
			$file = 'mystery-group-50.png';
		} else {
			$file = 'mystery-group.png';
		}

		$avatar = buddypress()->plugin_url . "bp-core/images/$file";
	}

	return $avatar;
}

Changelog

Changelog
Version Description
BuddyPress 2.6.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.