bp_get_displayed_user_avatar( array|string $args = '' )

Get the displayed user’s avatar.

Description

See also

Parameters

$args

(array|string) (Optional) Arguments are listed here with an explanation of their defaults. For more information about the arguments, see bp_core_fetch_avatar().

  • 'alt'
    (string) Default: 'Profile picture of [user name]'.
  • 'html'
    (bool) Default: true.
  • 'type'
    (string) Default: 'thumb'.
  • 'width'
    (int|bool) Default: false.
  • 'height'
    (int|bool) Default: false.

Default value: ''

Return

(string) User avatar string.

Source

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

	function bp_get_displayed_user_avatar( $args = '' ) {

		$r = wp_parse_args( $args, array(
			'item_id' => bp_displayed_user_id(),
			'type'    => 'thumb',
			'width'   => false,
			'height'  => false,
			'html'    => true,
			'alt'     => sprintf( __( 'Profile photo of %s', 'buddyboss' ), bp_get_displayed_user_fullname() )
		) );

		/**
		 * Filters the displayed user's avatar.
		 *
		 * @since BuddyPress 1.1.0
		 *
		 * @param string $value User avatar string.
		 * @param array  $r     Array of parsed arguments.
		 * @param array  $args  Array of initial arguments.
		 */
		return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( $r ), $r, $args );
	}

Changelog

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