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.
Ah, my mistake, there was an issue in the snippet. I corrected it and tested it now on my local site - it seems to work in my tests and I can see the Team area correctly in the backend.
Here for this to work, it's important that the slug of the role is "can-have-subagents". My concern is that it could be something else like "wp-role-can-have-subagents", or "can_have_subagents" with underscors, etc.
One way to check the role slug is to go to the Users page and right click -> inspect the roles dropdown, looking at the option values:
(for example here we have a role named Wholesale, but its slug is 'b2bking_role_1881").
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
Hi, this snippet (is is active) it's turned off 'TEAM" in plugin settings and no-one can see "my team menu tab: can You help me with it ?
Ah, my mistake, there was an issue in the snippet. I corrected it and tested it now on my local site - it seems to work in my tests and I can see the Team area correctly in the backend.
New version:
I also see My Team in the agent dashboard.
Here for this to work, it's important that the slug of the role is "can-have-subagents". My concern is that it could be something else like "wp-role-can-have-subagents", or "can_have_subagents" with underscors, etc.
One way to check the role slug is to go to the Users page and right click -> inspect the roles dropdown, looking at the option values:
(for example here we have a role named Wholesale, but its slug is 'b2bking_role_1881").
Let me know if it works for you now,