Validates that file is an image.
Parameters
$path
stringrequired- File path to test if valid image.
Source
function file_is_valid_image( $path ) {
$size = wp_getimagesize( $path );
return ! empty( $size );
}
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.