You are here

function shareaholic_node_prepare in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 includes/node.php \shareaholic_node_prepare()

Implements hook_node_prepare().

If the given node does not have shareaholic settings set, give default values in the object

Parameters

Object $node The node being shown in add/edit form:

File

includes/node.php, line 141
This file is responsible for containing hooks involving nodes

Code

function shareaholic_node_prepare($node) {
  if (empty($node->shareaholic_options)) {

    // Set default values, since this only runs when adding a new node
    // or an existing node without the values
    $node->shareaholic_options = array(
      'shareaholic_exclude_from_recommendations' => false,
      'shareaholic_hide_recommendations' => false,
      'shareaholic_hide_share_buttons' => false,
      'shareaholic_exclude_og_tags' => false,
    );
  }
}