You are here

function fb_social_send_link in Facebook social plugins integration 6

Implementation of hook_link

File

modules/fb_social_send/fb_social_send.module, line 124

Code

function fb_social_send_link($type, $object, $teaser = FALSE) {

  //only nodes are supported
  if ('node' != $type) {
    return;
  }

  // dont send unpublished nodes
  if (!$object->status) {
    return;
  }

  // if no widget on teasers return
  if ($teaser && !variable_get('fb_social_send_display_teasers', 1)) {
    return;
  }

  // widget is not to be displayed in the node links. return
  if (variable_get('fb_social_send_location', 0)) {
    return;
  }

  // good to go
  $links = array();
  if ($type == 'node' && fb_social_send_type($object->type)) {
    $links['fb_social_send'] = array(
      'title' => theme('fb_social_send_widget', fb_social_url('node/' . $object->nid)),
      'html' => TRUE,
    );
  }
  return $links;
}