I have this strange request from the client. They want to validate all users every 6 months. So what I’m thinking, is create a cron job to query for all “subscribers” and send a validate email. They will stay Pending, until they click the link, at which point they can continue to use the site.
I’m more than comfortable developing this within User Meta. My question is, where is a good place to start within this plugin, is there any methods / functions already for this? Maybe to take a use who is activated and set them Pending, initiate the email, etc?
Here is an example to deactivate a user and sending deactivation email.
// Deactivate user. you can also use 'pending'
update_user_meta($userID, 'user_meta_user_status', 'inactive');
// Sending deactivation email.
$user = new WP_User($userID);