You are here

function fel_wrapper_replace in Form element layout 7

Replace $search in $element['#theme_wrapper'] with $replace.

Parameters

string $search: The theme name to search for.

string $replace: Replacement theme name.

array $element: The element to search in.

6 calls to fel_wrapper_replace()
fel_element_info_alter in ./fel.module
Implements hook_element_info_alter().
fel_element_pre_render in ./fel.module
Replace #theme_wrapper => 'form_element' with our own.
fel_fields_date_process_description_display in modules/fel_fields/plugins/description_display/date.inc
Plugin callback.
fel_fields_element_info_alter in modules/fel_fields/fel_fields.module
Implements hook_element_info_alter().
fel_fields_file_process_description_display in modules/fel_fields/fel_fields.module
Common plugin callback for all 'file' types.

... See full list

File

./fel.module, line 316
Reorder #title, #description and #children in forms.

Code

function fel_wrapper_replace($search, $replace, array &$element) {
  if (!empty($element['#theme_wrappers'])) {
    $key = array_search($search, $element['#theme_wrappers']);
    if ($key !== FALSE) {
      unset($element['#theme_wrappers'][$key]);
      $element['#theme_wrappers'][] = $replace;
    }
  }
}