function _options_prepare_options
7.x options.module | _options_prepare_options(&$options, $properties) |
Sanitizes the options.
The function is recursive to support optgroups.
1 call to _options_prepare_options()
- _options_get_options in drupal-7.x/
modules/ field/ modules/ options/ options.module - Collects the options for a field.
File
- drupal-7.x/
modules/ field/ modules/ options/ options.module, line 267 - Defines selection, check box and radio button widgets for text and numeric fields.
Code
function _options_prepare_options(&$options, $properties) {
foreach ($options as $value => $label) {
// Recurse for optgroups.
if (is_array($label)) {
_options_prepare_options($options[$value], $properties);
}
else {
if ($properties['strip_tags']) {
$options[$value] = strip_tags($label);
}
if ($properties['filter_xss']) {
$options[$value] = field_filter_xss($label);
}
}
}
}