You are here

function ui_patterns_theme_suggestions_alter in UI Patterns 8

Implements hook_theme_suggestions_HOOK_alter().

File

./ui_patterns.module, line 47
Contains ui_patterns.module.

Code

function ui_patterns_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
  if (UiPatterns::getManager()
    ->isPatternHook($hook)) {
    \Drupal::moduleHandler()
      ->alter('ui_patterns_suggestions', $suggestions, $variables, $variables['context']);
    \Drupal::theme()
      ->alter('ui_patterns_suggestions', $suggestions, $variables, $variables['context']);
  }
  if ($hook == 'patterns_destination') {
    \Drupal::moduleHandler()
      ->alter('ui_patterns_destination_suggestions', $suggestions, $variables, $variables['context']);
    \Drupal::theme()
      ->alter('ui_patterns_destination_suggestions', $suggestions, $variables, $variables['context']);
  }
}