$user->data should have what you want.
// snip
elseif ( in_array( 'map_user', $user->roles ) )
return home_url( "/mapping/{$user->data->user_login}/" );
// end snip
Add if (!is_wp_error($user)) wp_die(var_dump($user)); to the top of your function to see what you have to work with. Caution: This will break things. (It throws a notice as well) It is for debugging only.
Related Posts:
- Redirect After Delete User in Backend
- How to target specific user role?
- Page template that redirects user based on role
- Redirect each user to specific pages based on their role
- Add Username to URL for redirect
- Redirect user to specific link after login
- Redirect Page ID, based on logged-in User Role
- Conditional redirect on login using referring URL
- Redirecting by role from a button
- Link WordPress Comment Admin Author name with About page
- How to force a 404 on WordPress
- WordPress redirecting connections on port 8080 to 80
- Disable ONLY URL auto complete, not the whole canonical URL system
- 301 redirect instead of 404 when URL is a prefix of a post or page name?
- Make A WordPress Page Accessible To Admins Only, Redirect Other User Roles
- Redirecting WordPress /.htaccess / HSTS / SSL
- Correct way to hide pseudo pages from being shown?
- Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’
- Redirect to post after submission with Gravity Forms? [closed]
- Redirect www to non-www htaccess
- Stop WordPress Redirection From /keyword to /some-post-containing-keyword/
- Specific URL has 403 Forbidden status code
- after login that will redirect user role into a page
- Using redirection plugin to pass URLs as lowercase to wordpress
- Prevent redirect to page/page when reserved term ‘name’ in $_POST when value is a page/post title
- Redirect to login page
- I want to redirect the url to the previous page
- Headers already sent – WordPress core
- Query WP data with the WPDB API from outside WordPress
- Get the final destination after WP_Http redirects (WordPress)
- Why specific file directory fails to redirect but its parent folder succeeds?
- Cant Access Website – Changed HTTP to HTTPs
- How to remove “YEAR/MONTH/” from uploads URL & redirect old URL to the new form?
- How to redirect user to a page after form submission
- How does WordPress redirect without using .htaccess?
- How do I redirect a user when he is logged in after clicking on a menu
- How to redirect from various ?page_id= to home page?
- Redirect 301 www.my-site.com/page/n to www.my-site.com/ [closed]
- Redirect not logged in users if they are on a specific page
- How to set up a single portfolio page as home page?
- How code a redirect back to page from form thanks
- How to use Regex to add to a url?
- htaccess redirect invoice.php to /client/invoice.php
- redirecting and showing notice from previous action
- Check Page requested, and redirect
- Redirect all requested url to new url
- Can’t control WordPress Addresses from admin panel
- reducing number of URL Redirects and increasing speed
- This redirect loop is eating my lunch! [closed]
- What is this code in my theme’s footer.php causing chmod permission warnings? [closed]
- Redirecting to new URL structure and 301
- Blog has an infinite redirect loop
- WP forwarding to wrong site address
- wp_login_form redirect problem
- Redirect from ip to domain
- How can I redirect users on the new 404 page without plugin?
- How does WordPress format the url on a 301 when a trailing slash is missing?
- Redirect only Blog posts to new
- Unwanted slug in my website
- HTTPS to HTTP rewrite rules not working as expected
- Preventing Canonical Redirect for CDN
- htaccess 301 Redirect not working from aspx to new WP permalink
- Redirecting simple big problem
- Redirect posts to new domain
- 302 Redirect is showing in the audit but links are opening separately
- Add base folder to CPT and 301
- Conditional Login Redirect
- wp_logout_url redirect not working
- How do i make WordPress return 404 instead of redirecting on misspelled page?
- how to redirect non logged users to login page and redirect to another page with saved data?
- How to redirect if 404 error in wordpress then redirect 404.php url
- WP Redirect with Wild Card Characters
- How to automatically redirect category pages (301) when changing the location of a category in the hierarchy
- Automatically switch language based on visitor’s country
- Do redirect 301 for wordpress page
- How to redirect user to Referrer Page using wp_signon in Custom Login Page in WordPress
- custom error message or redirect to custom page if any error occurs
- redirect after account activation for forum using bbpress and buddypress
- redirect_to ignoring the SSL
- Resolving the too many redirects on wordpress
- Redirect wordpress website URL into other link
- Redirect old .html URLs to a new installation in a subfolder
- Serve wordpress regardless of the cname
- Pass original URL through after login redirect
- redirects for removed/deleted woocommerce products
- Headers already sent error after upgrading wordpress to 4.2.2
- How to block direct access to files upload in edd folder
- Subpages return 404 server error
- Converted posts to a CPT, 301 redirects necessary?
- Accept (once only) policy page on login
- Rewrite rule to redirect to a particular filename.php
- Redirect to other page when mobile
- website is sending people to wrong address
- Why my htacess rewrite return 404?
- woocommerce shop page Redirect Help
- Create a 301 Redirect automatically when adding %category% in the permalink
- How to redirect non-logged in users to wordpress login page and bypass some page IDs?
- How can I redirect the user to the page they were on when they clicked “Lost Password” using “retrieve_password_message” filter
- login link with auto_redirect
- Redirect after registration and auto login is not working