Untitled-27 Back to Project

Getting Started Untitled-27

Customisation Untitled-27

Troubleshooting Untitled-27

Security Untitled-27

Users & roles Untitled-27

Working with Client Portal Untitled-27

Integrations Untitled-27

Legacy Documentation Untitled-27

How do I assign users who have a different role to a portal?

The easiest way to assign users multiple roles is to install this free plugin.

When you use this plugin, you'll be presented with a list of roles and you can select multiple roles for a user. This is the easier method and what we would recommend for any skill level!

Advanced method

Woah there! This is an advanced workaround for Client Portal. Make sure you backup your WordPress website before changing any codey things.

If you would like to assign users to a portal who are on your WordPress website in a role other than the default 'Client', follow the below steps:

1
After you've backed up your website, navigate to Appearance -> Editor.
2
Find Theme Functions (functions.php) on the right hand side.
3
Paste the following code at the bottom of your functions.php file:

function my_leco_cp_client_roles( $roles ) {
	$roles = array_merge( $roles, array( 'subscriber' ) );
	return $roles;
}
add_filter( 'leco_cp_client_roles', 'my_leco_cp_client_roles' );
4
Change the role to what you would like Client Portal to work with. (In the code example, we've set the role to 'Subscriber').

Allowing Client Portal to use multiple roles

If you'd like to use multiple roles with Client Portal, simply paste the following code at the bottom of your functions.php file and separate each role with a comma:

function my_leco_cp_client_roles( $roles ) {
	$roles = array_merge( $roles, array( 'administrator', 'editor', 'subscriber' ) );
	return $roles;
}
add_filter( 'leco_cp_client_roles', 'my_leco_cp_client_roles' );

Here's how your functions file should look: