You are here

function hook_sharemessage_token_context_alter in Share Message 7

Same name and namespace in other branches
  1. 8 sharemessage.api.php \hook_sharemessage_token_context_alter()

Allow other modules to alter sharemessage token context.

Parameters

$sharemessage: Currently loaded sharemessage object.

$context: Token Context.

1 invocation of hook_sharemessage_token_context_alter()
ShareMessage::buildContent in includes/sharemessage.entity.inc
Overrides Entity::buildContent().

File

./sharemessage.api.php, line 17
Hooks provided by share message module.

Code

function hook_sharemessage_token_context_alter($sharemessage, &$context) {
  global $language;

  // Alter sharemessage title.
  $sharemessage->sharemessage_title[$language->language][0]['value'] = 'Altered Title';

  // Add taxonomy_vocabulary object type in a $context array.
  $context['taxonomy_vocabulary'] = menu_get_object('taxonomy_vocabulary');
}