W3cubDocs

/Drupal 8

function hook_tour_tips_alter

hook_tour_tips_alter(array &$tour_tips, Drupal\Core\Entity\EntityInterface $entity)

Allow modules to alter tour items before render.

Parameters

array $tour_tips: Array of \Drupal\tour\TipPluginInterface items.

\Drupal\Core\Entity\EntityInterface $entity: The tour which contains the $tour_tips.

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/modules/tour/tour.api.php, line 21
Describes API functions for tour module.

Code

function hook_tour_tips_alter(array &$tour_tips, Drupal\Core\Entity\EntityInterface $entity) {
  foreach ($tour_tips as $tour_tip) {
    if ($tour_tip->get('id') == 'tour-code-test-1') {
      $tour_tip->set('body', 'Altered by hook_tour_tips_alter');
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!tour!tour.api.php/function/hook_tour_tips_alter/8.1.x