file_is_displayable_image
Filters whether the current image is displayable in the browser.
Использование
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.
По умолчанию: true - $path(строка)
- Path to the image.
Список изменений
| С версии 2.5.0 | Введена. |
Где вызывается хук
file_is_displayable_image
wp-admin/includes/image.php 1118
return apply_filters( 'file_is_displayable_image', $result, $path );