bp_get_group_creator_avatar( object|bool $group = false, array $args = array() )

Return the avatar of the creator of the current group in the loop.


Parameters Parameters

$group

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

Default value: false

$args

(array) (Optional) Array of optional arguments. See bp_core_fetch_avatar() for detailed description of arguments.

  • 'type'
    (string) Default: 'full'.
  • 'width'
    (int) Default: false.
  • 'height'
    (int) Default: false.
  • 'class'
    (int) Default: 'avatar'.
  • 'id'
    (string) Passed to 'css_id'. Default: false.
  • 'alt'
    (string) Alt text. Default: 'Group creator profile photo of [user display name]'.

Default value: array()


Top ↑

Return Return

(string)


Source Source

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

	function bp_get_group_creator_avatar( $group = false, $args = array() ) {
		global $groups_template;

		if ( empty( $group ) ) {
			$group =& $groups_template->group;
		}

		$r = bp_parse_args( $args, array(
			'type'   => 'full',
			'width'  => false,
			'height' => false,
			'class'  => 'avatar',
			'id'     => false,
			'alt'    => sprintf(
				/* translators: %s: group creator name */
				__( 'Group creator profile photo of %s', 'buddypress' ),
				bp_core_get_user_displayname( $group->creator_id )
			),
		), 'group_creator_avatar' );
		extract( $r, EXTR_SKIP );

		$avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) );

		/**
		 * Filters the avatar of the creator of the current group in the loop.
		 *
		 * @since 1.7.0
		 * @since 2.5.0 Added the `$group` parameter.
		 *
		 * @param string $avatar Avatar of the group creator.
		 * @param object $group  Group object.
		 */
		return apply_filters( 'bp_get_group_creator_avatar', $avatar, $group );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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