You are here

function hook_social_group_default_visibility_alter in Open Social 8.4

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

Provide a method to alter the default visibility used for a group type.

Parameters

string $visibility: The visibility option that is default.

string $group_type_id: The Group type we alter the visibility setting for.

1 invocation of hook_social_group_default_visibility_alter()
SocialGroupHelperService::getDefaultGroupVisibility in modules/social_features/social_group/src/SocialGroupHelperService.php
Returns the default visibility.

File

modules/social_features/social_group/social_group.api.php, line 35
Hooks provided by the Social Group module.

Code

function hook_social_group_default_visibility_alter(&$visibility, $group_type_id) {
  switch ($group_type_id) {
    case 'custom_public_group':
      $visibility = 'public';
      break;
    case 'custom_open_group':
      $visibility = 'community';
      break;
    case 'custom_closed_group':
      $visibility = 'group';
      break;
  }
}