function social_post_photo_preprocess_image_formatter in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8.2 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8.3 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8.4 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8.5 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8.6 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8.7 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 8.8 modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 10.3.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 10.0.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
- 10.1.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.module \social_post_photo_preprocess_image_formatter()
Implements hook_photo_preprocess_image_formatter().
File
- modules/
social_features/ social_post/ modules/ social_post_photo/ social_post_photo.module, line 33 - The Social post photo module.
Code
function social_post_photo_preprocess_image_formatter(&$variables) {
if ($variables['image_style'] === "social_post_photo" && empty($variables['image']['#alt'])) {
// At the moment there is no good alt text for photos in posts and the posts
// are usually descriptive enough that the images can be considered
// decorative. To properly indicate this we include an empty string as
// alt-text. This is better than using the filename which is meaningless in
// most cases. See Issue #2946442.
$variables['image']['#alt'] = "";
}
}