bp_core_avatar_dimension( string $type = 'thumb', string $h_or_w = 'height' )

Utility function for fetching an avatar dimension setting.


Description Description


Parameters Parameters

$type

(Optional) Dimension type you're fetching dimensions for. 'thumb' or 'full'. Default: 'thumb'.

Default value: 'thumb'

$h_or_w

(Optional) Which dimension is being fetched. 'height' or 'width'. Default: 'height'.

Default value: 'height'


Top ↑

Return Return

(int|bool) $dim The dimension.


Top ↑

Source Source

File: bp-core/bp-core-avatars.php

function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
	$bp  = buddypress();
	$dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false;

	/**
	 * Filters the avatar dimension setting.
	 *
	 * @since 1.5.0
	 *
	 * @param int|bool $dim    Dimension setting for the type.
	 * @param string   $type   The type of avatar whose dimensions are requested. Default 'thumb'.
	 * @param string   $h_or_w The dimension parameter being requested. Default 'height'.
	 */
	return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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