file_is_displayable_image
Filters whether the current image is displayable in the browser.
Usage
add_filter( 'file_is_displayable_image', 'wp_kama_file_is_displayable_image_filter', 10, 2 );
/**
* Function for `file_is_displayable_image` filter-hook.
*
* @param bool $result Whether the image can be displayed.
* @param string $path Path to the image.
*
* @return bool
*/
function wp_kama_file_is_displayable_image_filter( $result, $path ){
// filter...
return $result;
}
- $result(true|false)
- Whether the image can be displayed.
Default: true - $path(string)
- Path to the image.
Changelog
| Since 2.5.0 | Introduced. |
Where the hook is called
file_is_displayable_image
wp-admin/includes/image.php 1192
return apply_filters( 'file_is_displayable_image', $result, $path );