file_is_displayable_image
Filters whether the current image is displayable in the browser.
Description
Parameters (2)
- 0. $result (bool)
- Whether the image can be displayed. Default true.
- 1. $path (string)
- Path to the image.
Usage
- To run the hook, copy the example below.
- $result = apply_filters( 'file_is_displayable_image', $result, $path );
- if ( !empty( $result ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the file_is_displayable_image callback
- function filter_file_is_displayable_image( $result, $path ) {
- // make filter magic happen here...
- return $result;
- };
- // add the filter
- add_filter( 'file_is_displayable_image', 'filter_file_is_displayable_image', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'file_is_displayable_image', 'filter_file_is_displayable_image', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/image.php
- return apply_filters( 'file_is_displayable_image', $result, $path );