4 * List of available procedural hook and alter APIs for use in your sub-theme.
8 * @addtogroup plugins_alter
14 * Allows sub-themes to alter the array used for colorizing text.
17 * An associative array containing the text and classes to be matched, passed
20 * @see \Drupal\bootstrap\Bootstrap::cssClassFromString()
22 function hook_bootstrap_colorize_text_alter(&$texts) {
23 // This matches the exact string: "My Unique Button Text".
24 $texts['matches'][t('My Unique Button Text')] = 'primary';
26 // This would also match the string above, however the class returned would
27 // also be the one above; "matches" takes precedence over "contains".
28 $texts['contains'][t('Unique')] = 'notice';
30 // Remove matching for strings that contain "apply":
31 unset($texts['contains'][t('Apply')]);
33 // Change the class that matches "Rebuild" (originally "warning"):
34 $texts['contains'][t('Rebuild')] = 'success';
38 * Allows sub-themes to alter the array used for associating an icon with text.
41 * An associative array containing the text and icons to be matched, passed
44 * @see \Drupal\bootstrap\Bootstrap::glyphiconFromString()
46 function hook_bootstrap_iconize_text_alter(&$texts) {
47 // This matches the exact string: "My Unique Button Text".
48 $texts['matches'][t('My Unique Button Text')] = 'heart';
50 // This would also match the string above, however the class returned would
51 // also be the one above; "matches" takes precedence over "contains".
52 $texts['contains'][t('Unique')] = 'bullhorn';
54 // Remove matching for strings that contain "filter":
55 unset($texts['contains'][t('Filter')]);
57 // Change the icon that matches "Upload" (originally "upload"):
58 $texts['contains'][t('Upload')] = 'ok';
62 * @} End of "addtogroup".