You are here

function hook_entity_embed_alter in Entity Embed 8

Same name and namespace in other branches
  1. 7.3 entity_embed.api.php \hook_entity_embed_alter()
  2. 7 entity_embed.api.php \hook_entity_embed_alter()
  3. 7.2 entity_embed.api.php \hook_entity_embed_alter()

Alter the results of an embedded entity build array.

This hook is called after the content has been assembled in a structured array and may be used for doing processing which requires that the complete block content structure has been built.

Parameters

array &$build: A renderable array representing the embedded entity content.

\Drupal\Core\Entity\EntityInterface $entity: The embedded entity object.

array $context: The context array.

1 function implements hook_entity_embed_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_embed_test_entity_embed_alter in tests/modules/entity_embed_test/entity_embed_test.module
Implements hook_entity_embed_alter().

File

./entity_embed.api.php, line 104
Hooks provided by the Entity Embed module.

Code

function hook_entity_embed_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, array &$context) {

  // Remove the contextual links.
  if (isset($build['#contextual_links'])) {
    unset($build['#contextual_links']);
  }
}