Comments 2Lukasz started the conversationSeptember 27, 2024 at 11:28amHi i have sales agents and some of them has second user role "can-have-subagents" and I want to show the "Subagents" menu will be shown only for sales agent have "can-have-subagents" user role.Could You help me please ? 2,212WebWizards repliedSeptember 29, 2024 at 10:01amHi Lukasz, I believe that you're referring to the "My Team" tab / menu item on the agent dashboard, is that right? I believe you can achieve it, by adding this PHP snippet to your site: add_filter('salesking_dashboard_menu_items', function($menu) { $user = wp_get_current_user(); if ( ! in_array('can-have-subagents', (array) $user->roles)) { unset($menu['team']); } return $menu; }, 10, 1); add_filter('option_salesking_enable_teams_setting', function($val){ $user = wp_get_current_user(); if ( ! in_array('can-have-subagents', (array) $user->roles)) { $val = 0; } return $val; }, 10, 1); It should remove 'My Team' for any users that do not have that role. Let me know if that can solve it for you, Kind regards, Stefan Sign in to reply ...
Hi i have sales agents and some of them has second user role "can-have-subagents" and I want to show the "Subagents" menu will be shown only for sales agent have "can-have-subagents" user role.
Could You help me please ?
Hi Lukasz,
I believe that you're referring to the "My Team" tab / menu item on the agent dashboard, is that right?
I believe you can achieve it, by adding this PHP snippet to your site:
It should remove 'My Team' for any users that do not have that role.
Let me know if that can solve it for you,
Kind regards,
Stefan