WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/file is displayable image

Contents

Description

file_is_displayable_image determines whether or not the file passed to it is a displayable JPG, GIF, or PNG image.

Usage

 <?php file_is_displayable_image($path); ?> 

Examples

Default Usage

<?php file_is_displayable_image(ABSPATH . "/image/a-picture.jpg"); ?>

Parameters

$path
(filesystem path) (required) The absolute path of the image you want to check.
Default: None