You are here

function address_theme_suggestions_address_plain in Address 8

Implements hook_theme_suggestions_HOOK().

File

./address.module, line 39
Provides functionality for handling postal addresses.

Code

function address_theme_suggestions_address_plain(array $variables) {
  $suggestions = [];
  $original = $variables['theme_hook_original'] . '__';
  $field = $variables['address']
    ->getFieldDefinition();
  $entity_type_id = $field
    ->getTargetEntityTypeId();
  $bundle = $field
    ->getTargetBundle();
  $sanitized_view_mode = strtr($variables['view_mode'], '.', '_');
  $suggestions[] = $original . $entity_type_id . '__' . $sanitized_view_mode;
  $suggestions[] = $original . $entity_type_id . '__' . $bundle;
  $suggestions[] = $original . $entity_type_id . '__' . $bundle . '__' . $sanitized_view_mode;
  $suggestions[] = $original . $field
    ->getName();
  $suggestions[] = $original . $entity_type_id . '__' . $field
    ->getName();
  $suggestions[] = $original . $entity_type_id . '__' . $field
    ->getName() . '__' . $bundle;
  return $suggestions;
}