WordPress at Your Fingertips
function is not described

file_is_valid_image() WP 2.5.0

Validate that file is an image.

No Hooks.

Return

true|false. True if valid image, false if not valid image.

Usage

file_is_valid_image( $path );
$path(string) (required)
File path to test if valid image.

Changelog

Since 2.5.0 Introduced.

Code of file_is_valid_image() WP 5.8.2

function file_is_valid_image( $path ) {
	$size = wp_getimagesize( $path );
	return ! empty( $size );
}