function social_post_preprocess_activity in Open Social 8.4
Same name and namespace in other branches
- 8.9 modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 8.5 modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 8.6 modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 8.7 modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 8.8 modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 10.3.x modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 10.0.x modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 10.1.x modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
- 10.2.x modules/social_features/social_post/social_post.module \social_post_preprocess_activity()
Implements hook_preprocess_activity().
File
- modules/
social_features/ social_post/ social_post.module, line 214 - The Social post module.
Code
function social_post_preprocess_activity(&$variables) {
// Add visibility icon and label to activity posts.
if (!empty($variables['elements']['field_activity_entity'][0]['#post'])) {
$post = $variables['elements']['field_activity_entity'][0]['#post'];
$variables['visibility_icon'] = social_post_get_visibility_details($post
->get('field_visibility')->value, 'icon');
$variables['visibility_label'] = social_post_get_visibility_details($post
->get('field_visibility')->value, 'label');
}
}