Remove “edit profile” from user dashboard

Viewing 8 posts - 1 through 8 (of 8 total)
#173169

Margarida Barreto
Participant

Hi there, how can i remove the “Edit Profile” tab, from the user dashboard? I saw in documentation it was with a filter, using PHP. but i’m dont know here can i put the php code.

Thank you

#173200

Humayon
Spectator

Hi @margaridabarreto28,

Welcome to the support forum.

Can you please let us know which code you are referring to? so that we can give you a better solution about it.

Thanks.

#173229

Margarida Barreto
Participant

Hi there, i saw this info: <?php
add_filter(‘wpdm_user_dashboard_menu’,’my_custom_dashboard_menus’,10,1);
// $menu_items is an array containing current menu items
function my_custom_dashboard_menus($menu_items){
// Removing edit profile menu
unset($menu_items[‘edit-profile’]);
//Adding new menu item using callback function
$menu_items[‘new-menu-id-1’] = array(‘name’► __(‘Menu Title’,’text-domain’), ‘callback’ ► ‘CallbackFunction’);
//Adding new menu item using short-code
$menu_items[‘new-menu-id-2’] = array(‘name’► __(‘Menu Title’,’text-domain’), ‘shortcode’ ► ‘[short_code_here]’);
return $menu_items;
}
?>

It was in : https://www.wpdownloadmanager.com/doc/filter-reference/wpdm_user_dashboard_menu/

But i dont know what to do with it.

Thanks in advance

#173257

Humayon
Spectator

Hi,

Thank you for your reply.

Please apply the code mentioned earlier in your currently active theme’s functions.php file, which should resolve the issue.

Regards

#173667

Margarida Barreto
Participant

Hi,
i add this code in the functions.php file:

add_filter(‘wpdm_user_dashboard_menu’,’my_custom_dashboard_menus’,10,1);
// $menu_items is an array containing current menu items
function my_custom_dashboard_menus($menu_items){
// Removing edit profile menu
unset($menu_items[‘edit-profile’]);

}

however all the user area disappeared. I only want that people cannot have access to the “Edit Profile” to change their name or password but still see their downloads. Is it possible? Thanks

#173672

Shahjada
Keymaster

Please use the following code:

add_filter('wpdm_dashboard_menu', function ($menu){
	unset($menu['account']['items']['edit-profile']);		
	return $menu;
});
#173673

Margarida Barreto
Participant

Perfect!! Works just fine 🙂
Thank you so much!

#173674

Humayon
Spectator
This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Remove “edit profile” from user dashboard’ is closed to new replies.