0
当用户将数据注册到标准wp_users表时。 但是我创建了一个新表,我想将所有(新)registrerd用户存储在那里。 我该如何改变?将表wp_users中的用户注册更改为新的自制表
当用户将数据注册到标准wp_users表时。 但是我创建了一个新表,我想将所有(新)registrerd用户存储在那里。 我该如何改变?将表wp_users中的用户注册更改为新的自制表
add_action('user_register', 'myplugin_registration_save');
function myplugin_registration_save($user_id) {
// get the POST values and insert into the custom table
if (isset($_POST['first_name'])) {
// save into the custom table created
}
}
这不会阻止用户在WordPress上创建,但可以将用户数据插入到自定义表中。这会为你工作吗?
是的这有效,谢谢你的帮助:) –