0

I have a multisite setup - 2 sites for the same company. Because the sites are for the same company they both share several users with the role 'Editor'.

Is there a way to allow these users to switch between sites in the backend whilst keeping them as Editors? A particular capability I can add?

1

Although question is not quite clear to me, because:

==case 1==

if you have multisite WP, then users are shared with same username/password/etc). Just you should set the roles individually per sub-site. But if there are many users and you want to automatize the process, you can use:

update: As I see, you only need to "add" (not re-create users, but just "add") into the existing sub-domains. Go to http://your_site.com/wp-admin/network/sites.php, click each listed site individually> go to Users tab:

enter image description here

and insert username (or mail) into Existing user > choose Role and click add. (to automatize the work, if there are tens of users and subsites, you can use above plugins.

==case 2==

If you have separate installations of WP (and each WP installation is MS itself), then the possible way is like the previous answer suggests (sharing the user and usermeta tables), but note, there are cases, when in wp_options table there could be some information too for specific user, which wont be shared to second site in this case, and you will have to manually share... Not a quite easy trick, but you should live with that.

  • It's case 1 - but no users from the first site are present on the 2nd. Also as I said I'm looking for a way for them to switch between the sites using the top admin menu like you can as a network super admin – DJC Sep 1 '17 at 18:07
  • @CIvemy yes, it exactly does like you say, they can easily switch the sites.. but as i said, you only have to "add" the existing users to those sub-sites. i've updated answer, see it again. – T.Todua Sep 2 '17 at 19:15
  • The point is they can't easily switch sites. They have to go to each wp-admin URL individually. I know existing users can be added to another site in the network, I want them to be able to log in once and use the top menu to switch between sites - exactly as a superadmin does. – DJC Sep 5 '17 at 9:24
  • I am surprised - the same navigation top menu should appear for them too, exactly similar as super-admins see (just some sub-buttons wont be available and that's all), otherwise the nav-bar and "Sites" dropdown menu and others, should appear for them too. Maybe there is something other problem, that interferes to appear that menu? (if a user is added to multi-site, then he doesnt need to login to each site. just one login is enough and they should be auto-logined to all sub-sites). so, something specific problem with your site. – T.Todua Sep 6 '17 at 18:26
  • Are you sure? From what I understand - only superadmins get this menu by default - there is nothing peculiar about the setup of either site or their themes and changing themes makes no difference – DJC Sep 8 '17 at 8:25
0

If both sites share all users you could set the second site to use the _users and _usermeta tables from the first site by setting the following constants in the second site:

define('CUSTOM_USER_TABLE', 'yourprefix_1_users');
define('CUSTOM_USERMETA_TABLE', 'yourprefix_1_usermeta');

That would also have the advantage of users only needing to manage/remember one set of credentials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.