get('id') == 'tour-code-test-1') { $tour_tip->set('body', 'Altered by hook_tour_tips_alter'); } } } /** * Allow modules to alter tip plugin definitions. * * @param array $info * The array of tip plugin definitions, keyed by plugin ID. * * @see \Drupal\tour\Annotation\Tip */ function hook_tour_tips_info_alter(&$info) { // Swap out the class used for this tip plugin. if (isset($info['text'])) { $info['class'] = 'Drupal\my_module\Plugin\tour\tip\MyCustomTipPlugin'; } } /** * @} End of "addtogroup hooks". */