Skip to content

Instantly share code, notes, and snippets.

@mareksotak
Forked from waako/gist:3835276
Created October 4, 2012 18:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mareksotak/3835642 to your computer and use it in GitHub Desktop.
Save mareksotak/3835642 to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_form_alter().
To Replace the -Any- value in filters by it's label text
*/
function theme_form_alter(&$form, &$form_state, $form_id) {
kpr($form);
if ($form['#id'] == 'views-exposed-form-admin-people-block-1') {
// $my_label = 'label name';
foreach($form['#info'] as $key => $filter) {
if (stripos($key, 'filter-field') !== 0) {
$my_label = $form['#info'][$key]['label'];
$value = $form['#info'][$key]['value'];
if (isset($form[$value]['All'])) {
$form[$value]['All'] = $my_label;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment