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
- Changing Admin Menu Labels
- Is there ANY way to remove comments function and section totally?
- How to display a static HTML page while setting up a WordPress site?
- How can I uninstall a language?
- Best way to present options for home page in admin?
- How to add a custom metabox to the Menu Management admin screen?
- How to make ajax call in wordpress in right way?
- Delete Post From front Page ( With Wp-admin restriction )
- Add column to pages table
- How to get the password and username of the add new user form (admin back end) in wordpress
- Where can I edit Admin Panel Page file
- WordPress Error establishing a database connection For Admin login only
- Image editing: “Edit Original” and “Replace” buttons missing on old posts
- Failed to load resource admin-ajax.php
- Why are my frontend theme styles bleeding into the backend?
- Execute script only on certain admin pages
- Uncheck the box “Send User Notification” by default on new-user.php
- WordPress Options Page not working
- Admin account locked out/redirect loop. Other accounts work?
- Remove favorites action menu and screen options panel
- Admin access for custom user capabilities
- Prevent third party plugin’s admin page access based on user type
- No access local wordpress website after PC formating
- is_admin() not working when updating a post in the admin panel
- Why is server preventing admin styles? (Was: Where are WordPress sessions saved?)
- ‘wp’ hook supposed to trigger when editing a post?
- How to use underscore.js in WordPress Admin
- Cannot log in to the admin, no error message [closed]
- Need help for WordPress User Session Management?
- meta box on new admin page
- Create reviews and star-rating for user accounts in wp-admin [closed]
- Site Crashes When Updating to WordPress (Version 3.6)
- Admin top level menu, pointing to an external url
- Change of IP Address
- How can I control which plugins run in the dashboard?
- Too Many Redirects – WP-Admin Only
- WordPress admin section appears broken
- Wp-admin widgets have no title texts
- How to create directory under my active theme directory
- wp-admin 503 error
- On Users (user.php) in wp-admin disable/hide “Bulk Actions” and “Change Role To”
- Locked out of site admin after change of URL
- Login issue with subdomain installs
- Redirect from wp-admin back to page
- How can I can I make changes to a WP project I pulled from GItHub?
- site identity will not update [closed]
- str_replace in wp-admin
- Admin area is not loading properly
- Using meta_query in add_query_arg
- Is it possible to change the images source that are shown in the admin side?
- Using query string on edit CPT page
- All of my WordPress sites have Bold Open Sans
- WordPress Localhost migration issue