Menu local tasks and hook preprocess I just want to remove a secondary menu local task from a preprocess function such as

function mymodule_preprocess_menu_local_tasks(&amp;$vars, $hooks) { 
    $vars['secondary'] = '';
}


I'm using D7, sky theme for front-end and seven theme for admin.
The above code works in seven but not in sky.

The sky theme page.tpl.php has a variable $secondary_local_tasks which I might be able to remove from hook_preprocess_page(). I also tried this :

function mymodule_preprocess_page(&amp;$vars, $hooks) { 
    $vars['secondary_local_tasks'] = '';
    unset($vars['tabs']['#secondary']);
}


My hook is invoked correctly, but the secondary local task is still rendered to the template. Where local tasks are prepared to be rendered after my hook ?
Finally, I've done with hook_process_page() and removed the variable secondary_local_tasks upon logged-in user role before rendering to the template.

function mymodule_process_page(&amp;$vars, $hooks){
    global $user;
    if(array_key_exists(6, $user-&gt;roles) &amp;&amp; arg(0) == 'user' &amp;&amp; arg(2) == 'edit'){
        $vars['tabs']['#secondary'] = array();
        if(isset($vars['secondary_local_tasks'])){
            $vars['secondary_local_tasks'] = array();
        }
    }
}


I have also tried this from hook_preprocess_page(), but it did not work on the sky theme.
Related question is here : Profile2 and profile fields by user role