• Resolved Ced

    (@cedriccharles)


    Hello there 🙂

    I have a custom user role that I want to be used as “Agent” role. Is there a hook/filter that can make this role usable in the “Support staff” dropdown of a ticket?

    Kind regards,
    Cedric

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @cedriccharles

    Yes, you can use the following plugin to create the role.
    https://wordpress.org/plugins/user-role-editor/

    Regards

    Thread Starter Ced

    (@cedriccharles)

    Hi @jahmedas !

    Thank you, but this is not really what I need 🙂
    In fact, I have my custom role called “lawyers”. But the users attached to this role don’t appear in the “Support staff” dropdown attached to a new ticket. In this dropdown, I only have “administrators” or “agent”.
    I want to be able to choose my “lawyers” users in this dropdown.

    Thank you in advance,
    Cedric

    Hi @cedriccharles

    do you use any addon to create the user?

    Regards

    Thread Starter Ced

    (@cedriccharles)

    Hello,

    No, it’s custom code 😉 !

    I finally achieve this like that:

    $lawyer = $wp_roles->get_role('lawyer');
      
      $agent_cap = apply_filters( 'wpas_user_capabilities_agent', array(
    		'view_ticket',
    		'view_private_ticket',
    		'edit_ticket',
    		'edit_other_ticket',
    		'edit_private_ticket',
    		'assign_ticket',
    		'assign_ticket_creator',
    		'close_ticket',
    		'reply_ticket',
    		'create_ticket',
    		'delete_reply',
    		'attach_files',
    		'ticket_manage_tags',
    		'ticket_manage_products',
    		'ticket_manage_departments',
    		'ticket_manage_priorities',
    		'ticket_manage_channels',
    		'ticket_manage_privacy',
    		'ticket_manage_ticket_type',
    	) );
      
      foreach ( $agent_cap as $cap ) {
    		if ( null != $lawyer ) {
    			$lawyer->add_cap( $cap );
    		}
    	}

    Kind regards,
    Cedric

    Thread Starter Ced

    (@cedriccharles)

    This is resolved!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add a role as “agent”’ is closed to new replies.