Forum Replies Created
-
AuthorPosts
-
houftonMember
It seems that passwords are always re-hashed on import.
A way round it is to do a direct import of basic user information including passwords to the wp_users table using phpMyAdmin or similar (column names eg:
user_login,user_pass,user_nicename,user_email,user_registered,user_status,display_name)
and then use the User Meta Import to add extra fields, including First Name, Last Name and Role afterwards.houftonMemberThank you for your reply.
I have found another way to achieve what I want that is so simple and obvious that it makes me wonder why I spent so long trying to do it. I simply tried using %ID% as a placeholder in my Email Notifications and it works. %ID% is not in the list of User Placeholders (maybe it should be?) but it does appear when I did a print_r of $userMeta->getEmailsData( ‘registration’ ) which gave me the idea.
I then use user_meta_after_user_register or user_register to update the username with the ID included after the emails have been sent.
houftonMemberI have now used the user_register hook to do something like this instead:
// add_action( 'user_register', 'myFunction');
function myFunction( $user_id ){
$user = new WP_User($user_id);
echo $user->ID;
);
}The trouble is the registration email seems to get sent before this is called. I need to add the new user ID to the username before it is emailed out.
Can it be done using user_meta_after_user_register or another hook?
- This reply was modified 11 years, 8 months ago by houfton. Reason: typo
-
AuthorPosts