You are here

function hook_easy_social_widget in Easy Social 8.3

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

Implements hook_easy_social_widget().

Define additional Easy Social widgets.

In addition to specifying the widget's name and any external css and js includes, you're also expected to create a corresponding theme implementation for each widget you define. By default to it's expected to be the widget's machine_name prefixed by "easy_social_".

Return value

array An array with widget definitions, keyed by machine_name.

2 functions implement 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().
easy_social_example_easy_social_widget in contrib/easy_social_example/easy_social_example.module
Implements hook_easy_social_widget().
1 invocation of hook_easy_social_widget()
easy_social_get_widgets in ./easy_social.module
Return the available widgets.

File

./easy_social.api.php, line 16

Code

function hook_easy_social_widget() {
  return array(
    'example' => array(
      // Required. Widget human name. For administrative use only.
      'name' => t('Example widget'),
      // Scripts for this widget.
      // Each item is an array with script info, in the same format as
      // drupal_add_js(). They will get forwarded directly.
      'js' => array(
        array(
          'data' => '//platform.example.com/widgets.js',
          'type' => 'external',
        ),
      ),
      // Styles for this widget.
      // Each item is an array with style info, in the same format as
      // drupal_add_css(). They will get forwarded directly.
      'css' => array(
        array(
          'data' => '//platform.example.com/widgets.css',
          'type' => 'external',
        ),
      ),
    ),
  );
}