function file_entity_update_7213 in File Entity (fieldable files) 7.2
Same name and namespace in other branches
- 7.3 file_entity.install \file_entity_update_7213()
Update default alt text and title image field descriptions.
File
- ./
file_entity.install, line 1039 - Install, update and uninstall functions for the file_entity module.
Code
function file_entity_update_7213() {
if ($title_text_instance = field_info_instance('file', 'field_file_image_title_text', 'image')) {
if ($title_text_instance['description'] == 'Title text attribute') {
$title_text_instance['description'] = t('Title text is used in the tool tip when a user hovers their mouse over the image. Adding title text makes it easier to understand the context of an image and improves usability.');
field_update_instance($title_text_instance);
}
}
if ($alt_text_instance = field_info_instance('file', 'field_file_image_alt_text', 'image')) {
if ($alt_text_instance['description'] == '') {
$alt_text_instance['description'] = t('Alternative text is used by screen readers, search engines, and when the image cannot be loaded. By adding alt text you improve accessibility and search engine optimization.');
field_update_instance($alt_text_instance);
}
}
}