Filter 'login_redirect'.
Sample code, not tested:
add_filter( 'wp_login', 'wpse_78150_login_redirect' );
function wpse_78150_login_redirect( $url )
{
# uncomment the next line for debugging
# var_dump( wp_get_current_user() ); exit;
if ( ! current_user_can( 'custom_role' ) )
return $url;
return admin_url();
}
Related Posts:
- How to check if a user is in a specific role?
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- How to prevent access to wp-admin for certain user roles?
- Check if user is admin by user ID
- Change Login URL Without Plugin
- Only allow administrators and editors to access wp-admin
- create users to site with specific language
- Prevent from deleting any user role but subscriber
- What is the capability that permits access to WP-Admin?
- Displaying which Role the current user is assigned to
- How to hide a specific user role option in a user role list?
- Adding HTML/Text to Top of Subscriber’s Profile Backend Page
- Replace wordpress login logo with custom text
- Using /wp-admin works, using /login gives a 404. Why?
- Custom role based users are not able to access wp-admin
- Custom roles showing HTML entities in title form field
- Users Unable to Access Dashboard/Posts/Pages
- Only allow administrators and editors to access wp-admin
- FORCE_SSL_ADMIN not working
- Allow administrators to pick post author on custom post type edit screen
- Adding Custom Capabilites
- Restrict Author role to only 3 wp-admin pages
- Use Password Protected Form without the use of wp-login.php
- wp-admin – 404 after custom login form
- Why is unfiltered_upload not working despite being enabled?
- How to fix ‘WordPress redirection loop problem in wp-login.php page’?
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- WordPress server change – slow admin login time for first time
- White screen of death for wp-admin and error for wp-login.php after entering credentials
- Blank page for wp-admin after i uploaded the website from my localhost to the live server
- Downgrade admin account by mistake
- Why can I log into wp-login.php and not wp-admin.php?
- Disable Admin CP authentication (or auto login)
- User Capabilities are not available in WP REST permission callback?
- Change users.php WP_User_Query
- User Roles: How to hide a plugin from showing in WP-Admin?
- Is WordPress secure enough for a multi-user article directory?
- Newly created user role not displaying on users screen
- When i try to open Localhost/wordpress/wp-admin . An Error appears ” Registration Has been Disabled” . No login page is shown in the browser
- How to check if a user is in a specific role?
- Give wp-admin access for shop managers
- adding existing menu page on new customer user role
- Launch wordpress site to local computer from live website backed-up
- Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the “users search” input box
- Custom login form logo not displaying
- how to Hide all products except the General Manager role in the WordPress admin panel?
- WordPress site shows a white page for site/wp_admin. A login returns again to the login screen
- Unable to login or reset password via wp-admin
- Administrator user cannot access dashboard after localwp import
- WordPress change role from administrator to author by itself (automatically)
- login_enqueue_scripts changes are not reflecting
- Organizing Code in your WordPress Theme's functions.php File?
- Can I rename the wp-admin folder?
- How do I Enqueue styles/scripts on Certain /wp-admin Pages?
- Changing Admin Menu Labels
- Adding custom columns to custom post types
- Adding Fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?
- adding custom stylesheet to wp-admin
- Can’t change language (only “English (United States)”)
- Is there ANY way to remove comments function and section totally?
- How to use “menu_order” field for posts?
- “Too many redirects” ONLY when trying to access wp-admin page
- How to restrict dashboard access to Admins only?
- Admin Page Redirect
- Disable dragging of meta boxes?
- Toggle admin metabox based upon chosen page template
- When moving a WP site, why does wp-admin redirect to old site?
- How to disable the “Post Lock/Edit Lock”?
- adding the category to the admin column for a custom post type?
- How can we make managing lots of pages in WordPress Admin better?
- Change page title in admin area
- do_shortcode() within Admin Page
- How can I control the position in the admin menu of items added by plugins?
- Changing the ‘wp-admin’ URL to whatever I want
- Unit testing in the WordPress backend (is_admin() is true)
- Admin ajax request return 0 with die()
- How to remove screen options and help links in the admin area?
- How to remove the core embed blocks in WordPress 5.6?
- How to increase the file size limit for media uploads?
- Create WP tutorial for users with admin pointer using next button for navigation
- I’m getting a 404 message when I try to access wpadmin
- Taxonomy dropdown metabox in the back-end
- wordpress wp-admin css not loading
- Sort admin menu items
- How to order by post meta name in wp admin?
- How set defaults on wpLink()
- Remove dashboard, use Pages tab as default
- How to redirect/rewrite all /wp-login requests
- Show all post tags on post edit screen/sidebox
- How to hook in and modify the new revisions UI (3.6+)?
- How to display a static HTML page while setting up a WordPress site?
- Limit widget to certain sidebar?
- How can I uninstall a language?
- My wordpress site gets redirected automatically to the old site any known solution for this?
- Best way to present options for home page in admin?
- Use a different domain for SSL
- Remove specific items from Quick Edit menu of a Custom Post Type?
- How to filter by post-format in admin?
- Unable to login to my wordpress site. reauth=1 redirection loop
- Add “external” link to admin menu in the backend