Thanks Christian,
Made the change to the php code, adding the correct slug "ftm-puppy-seller" and "ftm-puppy-buyer" for the two roles.
// Login Redirect
function my_login_redirect( $redirect_to, $request, $user ) {
if( !isset( $user->user_login ) ){ // we only want this to run when credentials have been supplied
return $redirect_to;
}
//is there a user to check?
if (isset($user->roles) && is_array($user->roles)) {
//check for sellers
if (in_array('ftm-puppy-seller', $user->roles)) {
// redirect to seller my-account page
$redirect_to = '<em><u>enlace oculto</u></em>';
}
//check for buyers
if (in_array('ftm-puppy-buyer', $user->roles)) {
// redirect to my-buyer-account page
$redirect_to = '<em><u>enlace oculto</u></em>';
}
}
return $redirect_to;
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
Created a new Seller using the "Create Free Seller Account" Form, with "After Submitting the Form" set to "Go To Page", which was a page with only the following 2 shortcodes in it:
<p>[wpv-login-form allow_remember="true"]</p><br>
<p>[wpv-forgot-password-form]</p>
I was sent to a page giving me the options to login, or a "Forgot My Password" link. Entering the Seller Credentials just created, I was send to a post/page that showed only the correct referrer form in the URL - only other thing on the post/page was the title Login. It should be the new Seller's My Account Page.
Then, if I create a "Login -Seller" Page with the correct redirection in a shortcode to the My Account Page, it works! Problem is this means I have to have two Login Pages: Login-Seller and Login Buyer, which I am trying to avoid. The reason to avoid the two-login-pages solution is that when I tested it with a Buyer and Seller, both with accounts. A Buyer could login to the Seller Account, as well as their own. The Seller could login to the Buyer Account, as well as their own.
All this seems to be saying that the PHP redirect code is not working, or I am applying it incorrectly. But the manual, dual-login approach will not work. for the reasons cited. And for security reasons, I don't want to redirect a new Buyer or Seller directly to their respective account page without having them use their new credentials to login to their accounts the first time.
Thanks for hanging in there to see this through to a solution.