By playfulwolf on
The code in template.php:
function THEMENAME_form_views_exposed_form_alter(&$form, &$form_state) {
//dpm($form);
if ($form['#id'] == 'views-exposed-form-FORMID') {
$form['ITEMNAME']['#options']['All'] = t('My custom translatable text');
}
}
does work nice, but I want to have ITEMNAME select field label to appear instead of t('My custom translatable text'). Tried
$form['ITEMNAME']['#options']['All'] = $form['ITEMNAME']['#name']; or similar but no luck. Can someone give me a hint a missing line of code?
p.s. Stackoverflow seems to be crowded of those worried about some "ratings" but not knowledge
Comments
#title instead of #name
Instead of #name in $form['ITEMNAME']['#options']['All'] = $form['ITEMNAME']['#name']; , try #title as below: -
$form['ITEMNAME']['#options']['All'] = $form['ITEMNAME']['#title'];