You are here

function menu_fields_assure_localized_options_classes in Menu Item Fields 7

Assure that localized options are set.

Parameters

array $tree_data: The location where the options are set.

1 call to menu_fields_assure_localized_options_classes()
menu_fields_entity_view in ./menu_fields.module
Implements hook_entity_view().

File

./menu_fields.module, line 171
Main file contain hooks/functions.

Code

function menu_fields_assure_localized_options_classes(array &$tree_data) {
  foreach (element_children($tree_data) as $key) {
    if (isset($tree_data[$key]['#localized_options']['attributes']['class'])) {
      continue;
    }
    $tree_data[$key]['#localized_options']['attributes']['class'] = $tree_data[$key]['#attributes']['class'];
  }
}