5 * Describes API functions for tour module.
14 * Allow modules to alter tour items before render.
16 * @param array $tour_tips
17 * Array of \Drupal\tour\TipPluginInterface items.
18 * @param \Drupal\Core\Entity\EntityInterface $entity
19 * The tour which contains the $tour_tips.
21 function hook_tour_tips_alter(array &$tour_tips, Drupal\Core\Entity\EntityInterface $entity) {
22 foreach ($tour_tips as $tour_tip) {
23 if ($tour_tip->get('id') == 'tour-code-test-1') {
24 $tour_tip->set('body', 'Altered by hook_tour_tips_alter');
30 * Allow modules to alter tip plugin definitions.
33 * The array of tip plugin definitions, keyed by plugin ID.
35 * @see \Drupal\tour\Annotation\Tip
37 function hook_tour_tips_info_alter(&$info) {
38 // Swap out the class used for this tip plugin.
39 if (isset($info['text'])) {
40 $info['class'] = 'Drupal\mymodule\Plugin\tour\tip\MyCustomTipPlugin';
45 * @} End of "addtogroup hooks".