file_is_valid_image( string $path )
Validate that file is an image.
Parameters
- $path
-
(Required) File path to test if valid image.
Return
(bool) True if valid image, false if not valid image.
Source
File: wp-admin/includes/image.php
function file_is_valid_image($path) {
$size = @getimagesize($path);
return !empty($size);
}
Changelog
Version | Description |
---|---|
WP-2.5.0 | Introduced. |