function hook_moderation_sidebar_alter in Moderation Sidebar 8
Alter the build rendered in the moderation sidebar.
Parameters
array $build: The render array for the sidebar.
\Drupal\Core\Entity\EntityInterface $entity: The default or latest revision of an entity being moderated.
See also
\Drupal\moderation_sidebar\Controller\ModerationSidebarController::sideBar()
1 invocation of hook_moderation_sidebar_alter()
- ModerationSidebarController::sideBar in src/
Controller/ ModerationSidebarController.php - Displays information relevant to moderating an entity in-line.
File
- ./
moderation_sidebar.api.php, line 23 - Hooks related to moderation sidebar module.
Code
function hook_moderation_sidebar_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity) {
if ($entity
->getEntityTypeId() === 'my_great_type') {
$build['fun'] = [
'#markup' => '<a href="#" class="button">This does nothing, suckers!</a>',
];
}
}