I have a custom module with some simple code:
function theme_extras_form_alter(&$form, &$form_state, $form_id) {
if ($form['#id'] == 'views-exposed-form-blog-posts-page') {
$form['field_post_type_tid']['#options']['All'] = t('Refresh');
$form['field_post_type_tid']['#options']['3'] = t('<i class="icon-twitter"></i>');
}
}
The first replacement works beautifully, but the second renders as plain text, rather than html. I need to do this for every form element (in fact, refresh will even be replaced with an icon further down the road). What am I missing here to properly output the html?
I decided to pull this off using jQuery, as achieving the desired affect using a custom module was not pragmatic and may have, in fact, been overkill. Following is the poorly refactored but working code which got me there: