Multiple Single Installs of WordPress with a central user base

Im sorry that I am asking this but I have been searching for ages and for some reaseon the suggested custom user table dosn’t work, it just gives me a username error.

This is the code I am taking about:

define('CUSTOM_USER_TABLE','new_user_table');
define('CUSTOM_USER_META_TABLE', 'new_usermeta_table');

So I have a main Single install of WordPress, Lets say I have another on a subdomain (Subdomain A) and a different WordPress site which IS a Sub Directory MU Install on Sub Domain B. I only want people to create an account at the top, main site however they can log in on any of the domains. I would use MU but one of the sub sites is using MU so I cant. Single Sign on is not important but if possible then that would also be really good.

Any Ideas would be appreciated!

Cheers,
Joe

2 Answers
2

When you create a new user in such a shared user table, the roles and capabilities are set for one site only. The name and the ID will be available on all sites, but without any privileges the user cannot do anything useful.

You have to hook into 'user_register' and copy the roles and related data for all sites with custom code. You get the new user ID as a parameter.

Leave a Comment