public function views_handler_filter::prepare_filter_select_options in Views (for Drupal 7) 7.3
Sanitizes the HTML select element's options.
The function is recursive to support optgroups.
1 call to views_handler_filter::prepare_filter_select_options()
- views_handler_filter::exposed_translate in handlers/
views_handler_filter.inc - Make some translations to a form item to make it more suitable to exposing.
File
- handlers/
views_handler_filter.inc, line 1209 - Definitions of views_handler_filter and views_handler_filter_broken.
Class
- views_handler_filter
- Base class for filters.
Code
public function prepare_filter_select_options(&$options) {
foreach ($options as $value => $label) {
// Recurse for optgroups.
if (is_array($label)) {
$this
->prepare_filter_select_options($options[$value]);
}
elseif (is_object($label)) {
$this
->prepare_filter_select_options($options[$value]->option);
}
else {
$options[$value] = strip_tags(decode_entities($label));
}
}
}