function account_profile_menu_alter in Account Profile 7.2
Same name and namespace in other branches
- 6 account_profile.module \account_profile_menu_alter()
Implements hook_menu_alter().
Disable profile tabs if they are marked to be shown in accounts form.
File
- ./
account_profile.module, line 13 - Support for profiles in account page.
Code
function account_profile_menu_alter(&$items) {
$types = profile2_get_types();
/* We disable tabs for profiles marked as to
be shown as part of account form.*/
foreach ($types as $type) {
// @var $type ProfileType
if (isset($type->data['use_one_page']) && $type->data['use_one_page']) {
$items['user/%user_category/edit/' . $type->type]['access callback'] = FALSE;
}
}
}