最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - How to make wordpress use a non-wordpress users table?

programmeradmin0浏览0评论

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;
发布评论

评论列表(0)

  1. 暂无评论