wpseek.com
A WordPress-centric search engine for devs and theme authors



file_is_valid_image › WordPress Function

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:

Validates that file is an image.



Source

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