You are here

function hook_bootstrap_iconize_text_alter in Express 8

Allows sub-themes to alter the array used for associating an icon with text.

Parameters

array $texts: An associative array containing the text and icons to be matched, passed by reference.

See also

\Drupal\bootstrap\Bootstrap::glyphiconFromString()

1 function implements hook_bootstrap_iconize_text_alter()

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

bootstrap_bootstrap_iconize_text_alter in themes/contrib/bootstrap/bootstrap.theme
1 invocation of hook_bootstrap_iconize_text_alter()
Bootstrap::glyphiconFromString in themes/contrib/bootstrap/src/Bootstrap.php
Matches a Bootstrap Glyphicon based on a string value.

File

themes/contrib/bootstrap/bootstrap.api.php, line 46
List of available procedural hook and alter APIs for use in your sub-theme.

Code

function hook_bootstrap_iconize_text_alter(&$texts) {

  // This matches the exact string: "My Unique Button Text".
  $texts['matches'][t('My Unique Button Text')] = 'heart';

  // This would also match the string above, however the class returned would
  // also be the one above; "matches" takes precedence over "contains".
  $texts['contains'][t('Unique')] = 'bullhorn';

  // Remove matching for strings that contain "filter":
  unset($texts['contains'][t('Filter')]);

  // Change the icon that matches "Upload" (originally "upload"):
  $texts['contains'][t('Upload')] = 'ok';
}