BP_Attachment_Avatar::is_too_small( string $file = '' )

Check if the image dimensions are smaller than full avatar dimensions.


Description Description


Parameters Parameters

$file

(Optional) the absolute path to the file.

Default value: ''


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: bp-core/classes/class-bp-attachment-avatar.php

	public static function is_too_small( $file = '' ) {
		$uploaded_image = @getimagesize( $file );
		$full_width     = bp_core_avatar_full_width();
		$full_height    = bp_core_avatar_full_height();

		if ( isset( $uploaded_image[0] ) && $uploaded_image[0] < $full_width || $uploaded_image[1] < $full_height ) {
			return true;
		}

		return false;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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