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