You are here

function hook_pathauto_punctuation_chars_alter in Pathauto 8

Same name and namespace in other branches
  1. 6.2 pathauto.api.php \hook_pathauto_punctuation_chars_alter()
  2. 7 pathauto.api.php \hook_pathauto_punctuation_chars_alter()

Alter the list of punctuation characters for Pathauto control.

Parameters

array $punctuation: An array of punctuation to be controlled by Pathauto during replacement keyed by punctuation name. Each punctuation record should be an array with the following key/value pairs:

  • value: The raw value of the punctuation mark.
  • name: The human-readable name of the punctuation mark. This must be translated using t() already.
1 function implements hook_pathauto_punctuation_chars_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

pathauto_custom_punctuation_test_pathauto_punctuation_chars_alter in tests/modules/pathauto_custom_punctuation_test/pathauto_custom_punctuation_test.module
Implements hook_pathauto_punctuation_chars_alter().
1 invocation of hook_pathauto_punctuation_chars_alter()
AliasCleaner::getPunctuationCharacters in src/AliasCleaner.php
Return an array of arrays for punctuation values.

File

./pathauto.api.php, line 153
Documentation for pathauto API.

Code

function hook_pathauto_punctuation_chars_alter(array &$punctuation) {

  // Add the trademark symbol.
  $punctuation['trademark'] = [
    'value' => '™',
    'name' => t('Trademark symbol'),
  ];

  // Remove the dollar sign.
  unset($punctuation['dollar']);
}