function social_post_album_theme_suggestions_image_widget_alter in Open Social 10.1.x
Same name and namespace in other branches
- 10.3.x modules/social_features/social_post/modules/social_post_album/social_post_album.module \social_post_album_theme_suggestions_image_widget_alter()
- 10.0.x modules/social_features/social_post/modules/social_post_album/social_post_album.module \social_post_album_theme_suggestions_image_widget_alter()
- 10.2.x modules/social_features/social_post/modules/social_post_album/social_post_album.module \social_post_album_theme_suggestions_image_widget_alter()
Implements hook_theme_suggestions_HOOK_alter().
File
- modules/
social_features/ social_post/ modules/ social_post_album/ social_post_album.module, line 142 - The Social post album module.
Code
function social_post_album_theme_suggestions_image_widget_alter(array &$suggestions, array $variables) {
$element = $variables['element'];
$route_name = \Drupal::routeMatch()
->getRouteName();
if ($element['#field_name'] === 'field_post_image' && $route_name !== 'entity.post.edit_form') {
$suggestions[] = 'image_widget__album';
}
return $suggestions;
}