bp_core_fetch_avatar_filter( string $avatar, int|string|object $user, int $size, string $default, string $alt = '', array $args = array() )

Replace default WordPress avatars with BP avatars, if available.

Description Description

See ‘get_avatar’ filter description in wp-includes/pluggable.php.

Top ↑

Parameters Parameters


(string) (Required) The avatar path passed to 'get_avatar'.


(int|string|object) (Required) A user ID, email address, or comment object.


(int) (Required) Size of the avatar image ('thumb' or 'full').


(string) (Required) URL to a default image to use if no avatar is available.


(string) (Optional) Alternate text to use in image tag. Default: ''.

Default value: ''


(array) (Optional) Arguments passed to get_avatar_data(), after processing.

Default value: array()

Top ↑

Return Return

(string) BP avatar path, if found; else the original avatar path.

Source Source

File: bp-core/deprecated/2.9.php

function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '', $args = array() ) {
	_deprecated_function( __FUNCTION__, '2.9' );
	return $avatar;

Top ↑

Changelog Changelog

Version Description
2.4.0 Added $args parameter to coincide with WordPress 4.2.0.
1.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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