function social_search_alter_groups_exposed_filter_block in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_search/social_search.module \social_search_alter_groups_exposed_filter_block()
- 8.7 modules/social_features/social_search/social_search.module \social_search_alter_groups_exposed_filter_block()
- 10.3.x modules/social_features/social_search/social_search.module \social_search_alter_groups_exposed_filter_block()
- 10.0.x modules/social_features/social_search/social_search.module \social_search_alter_groups_exposed_filter_block()
- 10.1.x modules/social_features/social_search/social_search.module \social_search_alter_groups_exposed_filter_block()
- 10.2.x modules/social_features/social_search/social_search.module \social_search_alter_groups_exposed_filter_block()
Implements hook_form_FORM_ID_alter().
Makes changes for the filter block on the groups search page.
1 call to social_search_alter_groups_exposed_filter_block()
- social_search_form_views_exposed_form_alter in modules/
social_features/ social_search/ social_search.module - Implements hook_form_FORM_ID_alter().
File
- modules/
social_features/ social_search/ social_search.module, line 76 - The Social search module.
Code
function social_search_alter_groups_exposed_filter_block(&$form, FormStateInterface $form_state, $form_id) {
$options = [
'' => t('- Any -'),
];
$group_types = GroupType::loadMultiple();
/** @var \Drupal\group\Entity\GroupType $group_type */
foreach ($group_types as $group_type) {
$options[$group_type
->id()] = $group_type
->label();
}
$form['type'] = [
'#type' => 'select',
'#options' => $options,
];
}