in wordpress i want to send the user his password by mail?

sushil bharwani picture sushil bharwani · Dec 12, 2011 · Viewed 7.6k times · Source

i have a workflow in which a user when gets approved by system. Gets his login credentials as username and password. I want to send the user when he is approved his username and password in a mail. I am not sure how can i retrieve a user password from database is there an already existing function in wordpress?

Answer

jman picture jman · Dec 12, 2011

Wordpress doesn't store clear-text passwords. If you can, you'll have to generate a (new) password, update the wordpress database with the crypt hash (using wp_hash_password($clear_text_password)) and send the cleartext password by email after that DB update succeeds.