You are here

function _fences_theme_registry_alter in Fences 7

Same name and namespace in other branches
  1. 7.2 fences.admin.inc \_fences_theme_registry_alter()

Implements hook_theme_registry_alter().

1 call to _fences_theme_registry_alter()
fences_theme_registry_alter in ./fences.module
Implements hook_theme_registry_alter().

File

./fences.admin.inc, line 60
Functions only needed on configuration pages.

Code

function _fences_theme_registry_alter(&$theme_registry) {
  $fences = fences_get_fences_suggestion_info();

  // Manually registering module-based suggestions means they mistakenly get
  // preprocess and process functions registered to them.
  $supported_hooks = array(
    'field',
  );
  foreach ($supported_hooks as $hook) {
    foreach ($fences[$hook] as $suggestion => $data) {
      if ($fences[$hook][$suggestion]['type'] == 'module') {
        $hook_suggestion = $hook . '__fences_' . str_replace('-', '_', $suggestion);
        foreach (array(
          $hook_suggestion,
          $hook_suggestion . '_multiple',
        ) as $name) {
          unset($theme_registry[$name]['preprocess functions']);
          unset($theme_registry[$name]['process functions']);
        }
      }
    }
  }
}