You are here

function neutral_paths_pathauto_alias_alter in Neutral paths 8

Implements hook_pathauto_alias_alter().

File

./neutral_paths.module, line 36
Neutral paths.

Code

function neutral_paths_pathauto_alias_alter(&$alias, array &$context) {
  $types = \Drupal::config('neutral_paths.settings')
    ->get('neutral_paths_fix_new');
  $type = $context['pattern']
    ->getType();
  if (in_array($type, $types)) {
    $context['language'] = LanguageInterface::LANGCODE_NOT_SPECIFIED;
  }
}