Hi
I'm trying to alter the tabs in the user profile.
I have added an extra tab by using the hook_menu API and that was successfull.
But I'm now trying to remove the Posts tab in the user profiles by using the hook_menu_alter API. I have no sucess at the moment.
I want to remove the user/%user/posts because I have replaced it by another page with only some specific posts.
<?php
/**
* Implementation of hook_menu().
*/
function node_gallery_custom_menu() {
$items['user/%user/galleries'] = array(
'title' => 'My Galleries',
'page callback' => 'node_gallery_list',
'page arguments' => array(1),
'access callback' => '_node_gallery_custom_access',
'access arguments' => array(1),
'file' => 'node_gallery.pages.inc',
'file path' => drupal_get_path('module', 'node_gallery'),
'type' => MENU_LOCAL_TASK,
);
return $items;
}
function _node_gallery_custom_access($account) {
return in_array('photographer', $account->roles);
}
function node_gallery_custom_menu_alter(&$items) {
// what should I write here to disable $items['user/%user/posts']
}
Br.
Rune Christensen
Comments
unset($items['user/%user/post
unset($items['user/%user/posts']);Full-time freelancer, always looking for work.
jaypan.com (my portfolio)
I found the solution
Hi
Thanks, but I found another solution. The tab was from the advance profile kit and I found a View that was creating the tab. I have deactivated the View and now the tab has disappeared.
Br.
Rune