1. 8.5.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  2. 8.0.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  3. 8.1.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  4. 8.2.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  5. 8.3.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  6. 8.4.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  7. 8.6.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module

Support module for testing theme suggestions.

File

core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
View source
<?php

/**
 * @file
 * Support module for testing theme suggestions.
 */

/**
 * Implements hook_theme().
 */
function theme_suggestions_test_theme() {
  $items['theme_suggestions_test_include'] = array(
    'file' => 'theme_suggestions_test.inc',
    'variables' => array(),
    'function' => 'theme_theme_suggestions_test_include',
  );
  return $items;
}

/**
 * Implements hook_theme_suggestions_alter().
 */
function theme_suggestions_test_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
  drupal_set_message(__FUNCTION__ . '() executed.');
  if ($hook == 'theme_test_general_suggestions') {
    $suggestions[] = $hook . '__module_override';
  }
}

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function theme_suggestions_test_theme_suggestions_theme_test_suggestions_alter(array &$suggestions, array $variables) {
  drupal_set_message(__FUNCTION__ . '() executed.');
  $suggestions[] = 'theme_test_suggestions__' . 'module_override';
}

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function theme_suggestions_test_theme_suggestions_theme_test_function_suggestions_alter(array &$suggestions, array $variables) {
  $suggestions[] = 'theme_test_function_suggestions__' . 'module_override';
}

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function theme_suggestions_test_theme_suggestions_theme_test_specific_suggestions_alter(array &$suggestions, array $variables) {
  $suggestions[] = 'theme_test_specific_suggestions__' . 'variant__foo';
}

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function theme_suggestions_test_theme_suggestions_theme_test_suggestions_include_alter(array &$suggestions, array $variables, $hook) {
  $suggestions[] = 'theme_suggestions_test_include';
}

Functions