How to add a local task tab to node view? I'm trying to add an extra tab to the node 'view' and 'edit' tabs. 

My module is enabled fine and I have cleared cache, but my new tab doesn't appear. What am I missing?

/**
* Implements hook_menu().
*/
function add_performance_menu() {
  $items = array();

  $items['node/%node/performance'] = array(
    'title' =&gt; 'Add a performance',
    'page callback' =&gt; 'add_performance_action',
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_LOCAL_TASK,
  );

  return $items;
}

/**
* Page callback.
*/
function add_performance_action() {
  return t('Hello');
}
Your code looks good but Remember to clear your Drupal caches at admin/config/development/performance after every change to your hook_menu above.

The alternative that comes to mind,would be to use hook_menu_local_tasks_alter, because the menu item we want to use may be already exists.

You can also try this i hope it will help you:

/**
* Implements hook_menu().
*/
function add_performance_menu() {
  $items = array();
  $items['node/%node/performance'] = array(
    'title' =&gt; 'Add a performance',
    'access callback' =&gt; 'your_module_access_check',
    'access arguments' =&gt; array(1),
    'type' =&gt; MENU_LOCAL_TASK,
  );
  return $items;
}
function your_module_access_check($node) {
  if ($node-&gt;type == 'page') {
    return TRUE;
  }
  return FALSE;
}


Thanks