bp_core_avatar_dimension( string $type = 'thumb', string $h_or_w = 'height' )
Utility function for fetching an avatar dimension setting.
Description
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'
Return
(int|bool) $dim The dimension.
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 BuddyPress 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 ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.5.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.