function hook_addthis_markup_options_alter in AddThis 7.4
Implements hook_TYPE_alter().
Parameters
array $options: $options contains an array with configurations settings for used in the creation of the markup. The following elements may be in here.
- '#entity_type': The entity type this markup is define when called by a field.
- '#entity': Is the entity object when called by a field.
- '#display': Is always defined and provide all the formatter configuration.
- '#url': The link to the entity when the entity has a url.
1 invocation of hook_addthis_markup_options_alter()
- AddThis::getDisplayMarkup in classes/
AddThis.php
File
- ./
addthis.api.php, line 22 - This is currently a stub file that will be used to describe the addthis implementation API.
Code
function hook_addthis_markup_options_alter(&$options) {
global $base_root;
// Change the url used on the share buttons.
$options['#url'] = $base_root . request_uri();
// To apply different service this to the block implementation try this.
if (isset($options['#block']) && $options['#display']['type'] == 'addthis_basic_toolbox') {
// Change the var below to add other services.
$displayed_services = 'twitter,google_plusone,facebook';
$options['#display']['settings']['share_services'] = $displayed_services;
$options['#display']['settings']['buttons_size'] = AddThis::CSS_16x16;
}
}