function _fb_social_like_link in Facebook social plugins integration 7.2
Same name and namespace in other branches
- 6.2 plugins/fb_plugin/like.inc \_fb_social_like_link()
Pseudo hook_link for this plugin
File
- plugins/
fb_plugin/ like.inc, line 201
Code
function _fb_social_like_link($preset, $type, $object, $view_mode) {
$links = array();
// no like for unpublished nodes
if (!$object->status) {
return $links;
}
// if no plugin on this particular view_mode, return
if (empty($preset->settings['plugin_location']['node_view_modes'][$view_mode])) {
return $links;
}
// plugin is not to be displayed in the node links. continue
if ($preset->settings['plugin_location']['location']) {
return $links;
}
// good to go
if (fb_social_preset_node_types($preset, $object->type)) {
$preset->fb_attrs['href'] = fb_social_url('node/' . $object->nid);
$link_title = fb_social_preset_view($preset);
$links['fb-social-like-' . $preset->name] = array(
'title' => $link_title,
'html' => TRUE,
);
}
return $links;
}