Skip to content

Instantly share code, notes, and snippets.

@anthonyringoet
Created May 4, 2012 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyringoet/2592909 to your computer and use it in GitHub Desktop.
Save anthonyringoet/2592909 to your computer and use it in GitHub Desktop.
drupal addthis translatable title attributes
<?php
/**
* Implements hook_addthis_markup_alter.
*
* @param array $markup
* $markup contain an array with the structure of the addthis markup.
*/
function gluecode_addthis_markup_alter(&$markup) {
// alter markup to add title's that are translatable by Drupal
if (!empty($markup['twitter'])) {
$markup['twitter']['#attributes']['title'] = t("Stuur naar Twitter");
}
if (!empty($markup['facebook'])) {
$markup['facebook']['#attributes']['title'] = t("Stuur naar Facebook");
}
if (!empty($markup['google_plusone_share'])) {
$markup['google_plusone_share']['#attributes']['title'] = t("Stuur naar Google Plus");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment