You are here

function hook_ENTITY_TYPE_embed_context_alter in Entity Embed 7.3

Same name and namespace in other branches
  1. 8 entity_embed.api.php \hook_ENTITY_TYPE_embed_context_alter()

Alter the context of an particular embedded entity type before it is rendered.

Parameters

array &$context: The context array.

$entity: The entity object.

1 function implements hook_ENTITY_TYPE_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/entity_embed_test.module
Implements hook_entity_embed_context_alter().

File

./entity_embed.api.php, line 35
Hooks provided by the entity_embed module.

Code

function hook_ENTITY_TYPE_embed_context_alter(&$context, $entity) {
  if (isset($context['overrides']) && is_array($context['overrides'])) {
    foreach ($context['overrides'] as $key => $value) {
      $entity->key = $value;
    }
  }
}