_options_prepare_options
function _options_prepare_options
_options_prepare_options(&$options, $properties)
Sanitizes the options.
The function is recursive to support optgroups.
File
- modules/field/modules/options/options.module, line 268
- 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 { // The 'strip_tags' option is deprecated. Use 'strip_tags_and_unescape' // when plain text is required (and where the output will be run through // check_plain() before being inserted back into HTML) or 'filter_xss' // when HTML is required. if ($properties['strip_tags']) { $options[$value] = strip_tags($label); } if ($properties['strip_tags_and_unescape']) { $options[$value] = decode_entities(strip_tags($label)); } if ($properties['filter_xss']) { $options[$value] = field_filter_xss($label); } } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!modules!options!options.module/function/_options_prepare_options/7.x