function social_post_preprocess_post__activity in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_post/social_post.module \social_post_preprocess_post__activity()
- 8.6 modules/social_features/social_post/social_post.module \social_post_preprocess_post__activity()
- 8.7 modules/social_features/social_post/social_post.module \social_post_preprocess_post__activity()
- 8.8 modules/social_features/social_post/social_post.module \social_post_preprocess_post__activity()
- 10.3.x modules/social_features/social_post/social_post.module \social_post_preprocess_post__activity()
- 10.0.x modules/social_features/social_post/social_post.module \social_post_preprocess_post__activity()
- 10.1.x modules/social_features/social_post/social_post.module \social_post_preprocess_post__activity()
Implements hook_preprocess_post__activity().
File
- modules/
social_features/ social_post/ social_post.module, line 234 - The Social post module.
Code
function social_post_preprocess_post__activity(&$variables) {
$account = \Drupal::currentUser();
if (!$variables["published"] && !$account
->hasPermission('edit any post entities')) {
unset($variables["content"]["links"]);
}
}