wp_signon by user’s login by their particular role

/* Add code below wp_set_auth_cookie( $user->ID, true, false ); */ $current_user = wp_get_current_user(); if($current_user->roles[0]==’personal_account’){ wp_redirect(site_url(‘/profile’)); }else if($current_user->roles[0]==’corporate_user’){ wp_redirect(site_url(‘/corporate-profile’)); }

Adding a “Sign In/My Account” link to an external app

You can read cookies both on the front- and back-end sides. For the front-end, you have to provide both links, and show only the desired one with javascript. Use document.cookie.indexOf(‘cookie_name’) to check the cookie presence. For the back-end, you can read the special $_COOKIE variable to check the cookie presence in you template and change … Read more

How to add additional factor to wordpress authentication

I don’t know that I would use cookies for this as the user could just modify their cookie to match their current IP. You could store the user’s IP as user meta at signup and then compare that to their IP during subsequent logins via the wp_authenticate_user filter. Sample code (untested): add_action( ‘user_register’, ‘wpse157630_add_user_ip’, 10, … Read more

WP link for reset password is not received

You need to debug the main issue first wp-config.php define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, false); functions.php // define the wp_mail_failed callback function action_wp_mail_failed($wp_error) { return error_log(print_r($wp_error, true)); } // add the action add_action(‘wp_mail_failed’, ‘action_wp_mail_failed’, 10, 1); For more detail read this article LINK

Access to customer profile with pin code

Users aren’t stored as a post type like most other content in WordPress so you can’t use the per-page password feature in core. You can add a custom meta field to Users for the pin and then add some functions for displaying/handling the form, checking if the pin is valid, and so on. Another option … Read more