A WordPress-centric search engine for devs and theme authors



file_is_valid_image ›

Since2.5.0
Deprecatedn/a
file_is_valid_image ( $path )
Parameters:
  • (string) $path File path to test if valid image.
    Required: Yes
Returns:
  • (bool) True if valid image, false if not valid image.
Defined at:
Codex:

Validate that file is an image.



Source

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