Been making an attempt to get the next working, however maintain getting a surprising elseif. Does somebody know what I do improper?
/**
* WordPress perform for redirecting customers on login based mostly on consumer position
*/
perform my_login_redirect( $url, $request, $consumer ){
if ( $consumer && is_object( $consumer ) && is_a( $consumer, 'WP_User' ) ) {
if( $user->has_cap( 'administrator' ) ) {
$url = admin_url();
elseif( $users->has_cap( 'Subscriber' ) ) {
$redirect = 'https://mycustomlinkforsubscribers.com';
}
else {
$redirect = 'https://thenormallink';
}
}
return $url;
}
add_filter('login_redirect', 'my_login_redirect', 10, 3 );