You are here

function theming_example_preprocess_form_element_label in Examples for Developers 3.x

Implements hook_preprocess_HOOK().

Related topics

File

modules/theming_example/theming_example.module, line 144
Explains how a module declares theme functions, preprocess functions, and templates.

Code

function theming_example_preprocess_form_element_label(&$variables) {
  if (!empty($variables['element']['#attributes']['data-strong'])) {
    $variables['title']['#prefix'] = '<strong>';
    $variables['title']['#suffix'] = '</strong>';
    unset($variables['#attributes']['data-strong']);
  }
}