function file_icon_class

Same name in other branches
  1. 9 core/modules/file/file.module \file_icon_class()
  2. 8.9.x core/modules/file/file.module \file_icon_class()

Gets a class for the icon for a MIME type.

Parameters

string $mime_type: A MIME type.

Return value

string A class associated with the file.

Deprecated

in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\file\IconMimeTypes::getIconClass() instead.

See also

https://www.drupal.org/node/3411269

1 call to file_icon_class()
LegacyFileModuleTest::testFileIconClassDeprecation in core/modules/file/tests/src/Kernel/LegacyFileModuleTest.php
@covers ::file_icon_class

File

core/modules/file/file.module, line 1298

Code

function file_icon_class($mime_type) {
    @trigger_error(__FUNCTION__ . '() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \\Drupal\\file\\IconMimeTypes::getIconClass() instead. See https://www.drupal.org/node/3411269', E_USER_DEPRECATED);
    return IconMimeTypes::getIconClass($mime_type);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.