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

I've been searching and all I can find is how to share the users table from multiple wordpress sites. I tried using

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;

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744725001a4590123.html

相关推荐

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

    I've been searching and all I can find is how to share the users table from multiple wordpress sites. I tried using

    3天前
    90

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信