You are here

function whatsappshare_init in Whatsapp Share 7

Same name and namespace in other branches
  1. 7.3 whatsappshare.module \whatsappshare_init()
  2. 7.2 whatsappshare.module \whatsappshare_init()

Note This hook is run at the beginning of the page request.

File

./whatsappshare.module, line 43
Help to share your content on whatsapp.

Code

function whatsappshare_init() {
  global $base_url;
  $path = $base_url . '/' . request_path();
  drupal_add_js(array(
    'whatsappshare' => array(
      'whatsappshare_button_text' => variable_get('whatsappshare_button_text', t('Share on whatsapp')),
      'whatsappshare_button_size' => variable_get('whatsappshare_button_size', t('Small')),
      'whatsappshare_sharing_text' => variable_get('whatsappshare_sharing_text', t('Your sharing text will come here.')),
      'base_path' => $path,
    ),
  ), 'setting');
  drupal_add_js(drupal_get_path('module', 'whatsappshare') . '/js/whatsappshare.js');
}