You are here

function heartbeat_like_preprocess_flag in Heartbeat 8

Same name in this branch
  1. 8 modules/heartbeat_like/heartbeat_like.module \heartbeat_like_preprocess_flag()
  2. 8 modules/heartbeat_comment_like/heartbeat_like.module \heartbeat_like_preprocess_flag()

Implements hook_preprocess_HOOK().

File

modules/heartbeat_comment_like/heartbeat_like.module, line 40

Code

function heartbeat_like_preprocess_flag(&$variables) {

  // Replace the link title with any tokens.
  $token = Drupal::token();
  $variables['title'] = $token
    ->replace($variables['title'], array(
    'flag_id' => $variables['flag']
      ->id(),
    'entity_id' => $variables['flaggable']
      ->id(),
  ));
}