function hook_entity_embed_context_alter in Entity Embed 8
Same name and namespace in other branches
- 7.3 entity_embed.api.php \hook_entity_embed_context_alter()
- 7 entity_embed.api.php \hook_entity_embed_context_alter()
- 7.2 entity_embed.api.php \hook_entity_embed_context_alter()
Alter the context of an embedded entity before it is rendered.
Parameters
array &$context: The context array.
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
1 function implements hook_entity_embed_context_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_context_alter in tests/
modules/ entity_embed_test/ entity_embed_test.module - Implements hook_entity_embed_context_alter().
File
- ./
entity_embed.api.php, line 66 - Hooks provided by the Entity Embed module.
Code
function hook_entity_embed_context_alter(array &$context, \Drupal\Core\Entity\EntityInterface $entity) {
if (isset($context['overrides']) && is_array($context['overrides'])) {
foreach ($context['overrides'] as $key => $value) {
$entity->key = $value;
}
}
}