function tweetbutton_hashtag_get_attributes in Tweet Button 8
Same name and namespace in other branches
- 7.2 tweetbutton.module \tweetbutton_hashtag_get_attributes()
Helper function to build attributes of hashtag.
Parameters
array $options: Context specific options.
Return value
List of attributes to be rendered for hashtag.
1 call to tweetbutton_hashtag_get_attributes()
- theme_tweetbutton_hashtag_display in ./
tweetbutton.module - Returns HTML for a hashtag.
File
- ./
tweetbutton.module, line 163 - Adds block with tweet and follow buttons.
Code
function tweetbutton_hashtag_get_attributes($options) {
$language = \Drupal::languageManager()
->getCurrentLanguage();
$default_options = array(
'rel_account' => variable_get('tweetbutton_account'),
);
$options += $default_options;
$attributes = array(
'data-related' => $options['rel_account'],
'data-lang' => $options['language'] == 'auto' ? $language->id : $options['language'],
'class' => 'twitter-hashtag-button',
);
}