You are here

function hook_social_post_visibility_info_alter in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  2. 8.4 modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  3. 8.5 modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  4. 8.7 modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  5. 8.8 modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  6. 10.3.x modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  7. 10.0.x modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  8. 10.1.x modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()
  9. 10.2.x modules/social_features/social_post/social_post.api.php \hook_social_post_visibility_info_alter()

Provide a method to alter the icon and title for post visibility.

Parameters

string $visibility: The current field_visibility value, "1" for 'Community' etc.

File

modules/social_features/social_post/social_post.api.php, line 21
Hooks provided by the Social Post module.

Code

function hook_social_post_visibility_info_alter($visibility, &$icon, &$title) {
  switch ($visibility) {
    case '5':
      $icon = 'community';
      $title = t('Community');
      break;
    case '6':
      $icon = 'lock';
      $title = t('Closed');
      break;
  }
}