bp_get_new_group_avatar( array|string $args = '' )

Return the avatar for the group currently being created


Description Description

See also See also


Top ↑

Parameters Parameters

$args

(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: 'Group photo'.
  • 'class'
    (string) Default: 'avatar'.
  • 'type'
    (string) Default: 'full'.
  • 'width'
    (int|bool) Default: false.
  • 'height'
    (int|bool) Default: false.
  • 'id'
    (string) Passed to $css_id parameter. Default: 'avatar-crop-preview'.

Default value: ''


Top ↑

Return Return

(string) The avatar for the group being created


Top ↑

Source Source

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

	function bp_get_new_group_avatar( $args = '' ) {

		// Parse arguments.
		$r = bp_parse_args( $args, array(
			'type'    => 'full',
			'width'   => false,
			'height'  => false,
			'class'   => 'avatar',
			'id'      => 'avatar-crop-preview',
			'alt'     => __( 'Group photo', 'buddypress' ),
		), 'get_new_group_avatar' );

		// Merge parsed arguments with object specific data.
		$r = array_merge( $r, array(
			'item_id'    => bp_get_current_group_id(),
			'object'     => 'group',
			'avatar_dir' => 'group-avatars',
		) );

		// Get the avatar.
		$avatar = bp_core_fetch_avatar( $r );

		/**
		 * Filters the new group avatar.
		 *
		 * @since 1.1.0
		 *
		 * @param string $avatar HTML markup for the new group avatar.
		 * @param array  $r      Array of parsed arguments for the group avatar.
		 * @param array  $args   Array of original arguments passed to the function.
		 */
		return apply_filters( 'bp_get_new_group_avatar', $avatar, $r, $args );
	}

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.