You are here

function advagg_install_theme_registry_location in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7 advagg.install \advagg_install_theme_registry_location()
1 call to advagg_install_theme_registry_location()
advagg_requirements in ./advagg.install
Implementation of hook_requirements().

File

./advagg.install, line 273
Handles Advanced Aggregation installation and upgrade tasks.

Code

function advagg_install_theme_registry_location($hooks) {

  // Define hooks that we can safely ignore, that get executed after advagg.
  $ignored_hooks = array(
    'labjs_preprocess_page',
    'headjs_preprocess_page',
    'designkit_preprocess_page',
    'cdn_preprocess_page',
    'conditional_styles_preprocess_page',
  );

  // Call hook_advagg_theme_registry_alter().
  drupal_alter('advagg_theme_registry', $ignored_hooks);

  // Get preprocess hooks.
  $hooks = $hooks['page']['preprocess functions'];

  // Removed ignored hooks.
  foreach ($ignored_hooks as $hook) {
    $key = array_search($hook, $hooks);
    if ($key !== FALSE) {
      unset($hooks[$key]);
    }
  }
  return $hooks;
}