You are here

function hook_easy_social_widget in Easy Social 7.2

Same name and namespace in other branches
  1. 8.4 easy_social.api.php \hook_easy_social_widget()
  2. 8.3 easy_social.api.php \hook_easy_social_widget()

Implements hook_easy_social_widget().

This is how you define additional share widgets.

1 function implements hook_easy_social_widget()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

easy_social_easy_social_widget in ./easy_social.module
Implements hook_easy_social_widget().
1 invocation of hook_easy_social_widget()
easy_social_get_widgets in ./easy_social.module
Returns a list of enabled Easy Social widgets.

File

./easy_social.api.php, line 17
Easy Social API documentation.

Code

function hook_easy_social_widget() {
  return array(
    'my_custom_share_button' => array(
      'name' => 'My Custom Share Button',
      // This appears on admin pages only.
      'markup' => '_mymodule_custom_share_button_markup',
      // Callback function that returns widget markup.
      'scripts' => array(
        array(
          'path' => 'http://mycustomshare.com/widget.js',
          // JavaScript include, if any.
          'type' => 'external',
        ),
      ),
      'styles' => array(
        array(
          'path' => drupal_get_path('module', 'easy_social') . '/css/easy_social_twitter.css',
          // CSS include, if any.
          'type' => 'external',
        ),
      ),
    ),
  );
}