S
S
S1MY2020-04-26 21:12:59
WordPress
S1MY, 2020-04-26 21:12:59

How to create two table registration in wordpress?

Hello, I need your help, I can't do it myself!
There are two sites site.ru and site.com, there is a need that when adding a new user through the admin panel, the data is recorded in two tables.
The wp_users table and the wp_com_users table have the same data, i.e. the logins and passwords are the same.
It is necessary to make sure that when registering on site.ru from the wp_users table, the data is copied to wp_com_users. Thank you in
advance for your answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2020-04-27
@S1MY

I would advise you to approach the problem from a different angle. In fact, users should be created in one table, more precisely in one pair of tables ( wp_usersand wp_usermeta), and stored in a single instance. And on the second site, you simply indicate that you need to use this pair of tables from the first site. There wp-config.phpare 2 configuration constants for this:

define( 'CUSTOM_USER_TABLE', $table_prefix.'my_users' );
define( 'CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta' );

Read more here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question