Public Ticket #2869266

adding agent user to a specific role

Closed
Comments
3 Tickets
faiz started the conversation 5 years ago on September 10, 2021 at 12:06pm

I'm using an if menu where I want the agent dashboard page menu will only be shown 
1. to the specific user role
2. is login

I want to setup that each agent have the same clearance as a customer role but have different role name.

2,762
KingsPlugins replied 5 years ago on September 10, 2021 at 12:42pm

Hi Faiz,

Thank you for purchasing SalesKing!


If you want to hide the "Agent Dashboard" item in the menu for users that are not agents, it would be simple to hide it with CSS (I think doing it with a different role is much harder). SalesKing adds classes to the body, so we can use that to hide it.

You can add:

.salesking_not_agent #your_menu_item{
    display: none !important;
}

In the above CSS, you just need to replace #your_menu_item with the class/ID of the item in your menu. I can give you the correct ID/class if you can give me a link to your website.


Kind regards,

Stefan



1
2,762
KingsPlugins replied 5 years ago on September 11, 2021 at 2:51pm

Glad that's sorted!


Yes, you can achieve that redirect by adding this PHP code snippet to your site:

add_filter('salesking_sales_agent_redirect', function($redirect_to){
    return get_home_url();
}, 10, 1);

Tested and it works, agents are redirected to the homepage when they log out.

Kind regards,

Stefan

Sign In