I’m looking to advise a user that they should change their password from the default generated one that was emailed to them.
Is there a function or hook that will tell me if the user is running the default password?
I’m looking to advise a user that they should change their password from the default generated one that was emailed to them.
Is there a function or hook that will tell me if the user is running the default password?
You must be logged in to post a comment.
The following will tell you if the user has updated the password generated by WP on registration for a user with ID
$user_id
:If you want to send an email @goldenapples’ answer is good (replacing the logic in
user_password_check
for checking whether the password has been changed with my logic.)The question is, how are you setting the default passwords?
That said, I think it would be perfectly reasonable to trigger a scheduled action in say, a weeks time from the date you create the user. It should be pretty simple, something like this would probably do the trick:
(I didn’t test it yet, so I’m not sure if it will stand up to real use. Treat it as pseudo-code for what you’re trying to do.)