admin管理员组

文章数量:1391964

I've been searching and all I can find is how to share the users table from multiple wordpress sites. I tried using define( 'CUSTOM_USER_TABLE', 'Users' );, but it's not working. I image it is because my users table has different column names.

I've been searching and all I can find is how to share the users table from multiple wordpress sites. I tried using define( 'CUSTOM_USER_TABLE', 'Users' );, but it's not working. I image it is because my users table has different column names.

Share Improve this question asked Feb 21, 2020 at 19:51 user3642768user3642768 111 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

I figured it out. All I did was create a VIEW mapping the columns like this:

CREATE VIEW wp_users (ID, user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name)
AS SELECT u.user_id, u.username, u.password, u.first_name, u.email, '', u.date_created, '', 0, u.display_name
FROM Users u;

本文标签: customizationHow to make wordpress use a nonwordpress users table