function template_preprocess_social_media_links_platform in Social Media Links Block and Field 7
Processes variables for social-media-links-platform.tpl.php.
See also
theme_social_media_links_platform()
File
- ./
social_media_links.module, line 363 - Functions for the Social Media Links module.
Code
function template_preprocess_social_media_links_platform(&$variables) {
$info = $variables['info'];
$name = $variables['name'];
$value = $variables['value'];
$icon_style = $variables['icon_style'];
// Call the url callback of the platform to create the link url.
$variables['link'] = $info['base url'] . $value;
if (isset($info['url callback'])) {
$platform_url_changed = call_user_func($info['url callback'], $info['base url'], $value);
if ($platform_url_changed) {
$variables['link'] = $platform_url_changed;
}
}
$variables['attributes']['title'] = check_plain($info['title']);
$variables['icon_path'] = social_media_links_icon($icon_style[0], $name, $icon_style[1]);
$variables['icon_alt'] = isset($info['image alt']) ? $info['image alt'] : $info['title'] . ' ' . t('icon');
}