You are here

function hook_social_user_name_display_suggestions_alter in Open Social 8.9

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

Alters the list of display suggestions that determine the user display name.

Parameters

array $suggestions: The array of suggestion objects generated by hook_social_user_name_display_suggestions() implementations.

\Drupal\Core\Session\AccountInterface $account: The account to modify display name suggestions for.

2 functions implement hook_social_user_name_display_suggestions_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

social_profile_fields_social_user_name_display_suggestions_alter in modules/social_features/social_profile/modules/social_profile_fields/social_profile_fields.module
Implements hook_social_user_name_display_suggestions_alter().
social_profile_privacy_social_user_name_display_suggestions_alter in modules/social_features/social_profile/modules/social_profile_privacy/social_profile_privacy.module
Implements hook_social_user_name_display_suggestions_alter().
1 invocation of hook_social_user_name_display_suggestions_alter()
social_user_user_format_name_alter in modules/social_features/social_user/social_user.module
Implements hook_user_format_name_alter().

File

modules/social_features/social_user/social_user.api.php, line 242
Hooks provided by the Social_user module.

Code

function hook_social_user_name_display_suggestions_alter(array &$suggestions, AccountInterface $account) {

  // Logged in users are not allowed to view users' full name.
  if (\Drupal::currentUser()
    ->isAuthenticated()) {
    unset($suggestions['full_name']);
  }
}