The action you’re looking for is auth_redirect, which is before the headers but still recognizes $pagenow to tell which page you’re on:
add_action('auth_redirect', 'the_mobile_boot');
function the_mobile_boot() {
global $pagenow;
if ( $pagenow == 'index.php' && wp_is_mobile() ) {
header( 'Location: ' . get_admin_url(null, 'edit.php') );
exit;
}
}
Related Posts:
- Admin Page Redirect
- how to redirect to url.com/wp-admin if url.com/admin is typed in?
- Change the Default Pages Menu View in wp-admin
- What are the standard admin CSS id/class tags?
- Modal window from within WordPress admin
- How to Change the Default Home Page for the WordPress Dashboard?
- How To Remove WordPress Version From The Admin Footer
- Set Default Admin Colour For All Users
- Securing Admin Accounts – Username Discovery
- Can an admin check passwords of registered users?
- How-to make the admin area mobile friendly [closed]
- How to obtain the user ID of the current profile being edited in WP-Admin?
- 3.3: How do you hide the new dashboard welcome panel?
- Make A WordPress Page Accessible To Admins Only, Redirect Other User Roles
- Redirect Admin User in Dashboard
- stop redirection on /wp-admin call to /wp-login
- Appearance->Editor not visible
- Possible to create placeholder images in WordPress editor that are clickable (should bring up uploader)?
- Admin pages have no content
- Login to wp-admin “redirect_to” points to wrong URL after migration
- Blocking Administrative Access to Authors and Subcribers?
- How to find out if an wp-admin action edited a file?
- How to display only logged in user’s post comments in comments area
- WordPress 3.8 get current admin color scheme
- How to Use Resposive Tables in WordPress ADMIN Pages?
- WordPress redirects me to homepage after page update in admin section
- How can I access profile Admin Colour Scheme
- I keep getting logged out in Firefox
- Add tabbed menu to admin page
- remove_action with profile_personal_options
- Getting the different post statuses + count like in edit.php, in a custom submenu page
- How To Create User Specific Admin User Pages?
- Conditionally load CSS/JS/PHP in wp-admin if using a mobile device
- How to disable automatic excerpt generation *in admin*?
- Limit Words in Category / Term Description – Admin Panel
- Change top level menu item to point to custom submenu item
- Admin page redirect to another admin page
- Associating custom submenu item with post type of top level menu item
- Adding text in more than one language (at the same time)
- wp-admin post.php JavaScript Links Not Working
- Super slow admin panel
- Admin Taxonomy Terms – Orderby Term Field
- How do I add an admin notice within javascript in the admin interface for posts?
- Fatal error: Exception thrown without a stack frame in Unknown on line 0
- Hide Pages on Edit Pages based on Capability (edit_others_pages)?
- WordPress Admin Login Redirect Problem
- Unable to Access WP Admin or Login buttons after Migration
- Add ‘Last Modified’ and Attachments (Yes/No) to WordPress Users Column
- Editors change a permalink on an unpublished post, but only admins change a permalink on a post that has ever been published?
- How Can I Found Admin Directory
- WordPress post feature image not uploading
- Combine and Minify wp-admin files, also re-write URI’s for CDN
- Redirect in an Admin page
- 500 internal server error on wp-admin only
- Site’s admin created with wpmu_create_blog accessible only on 2nd attempt
- Seems that admin_post_{action} does not executing
- Add Custom Script in Other Plugin’s Options page
- When submitting the form site.com/blog/wp-admin it goes to site.com/wp-admin
- Can I host WP-admin locally for a remote blog?
- get_current_screen and the WP_Screen class
- Can’t access wp-admin, redirects to http://%24domain/wp-admin/
- Is there alternative to WP_List_Table?
- WordPress Brute Force Prevention
- Admin login not working
- Adding and removing columns from the admin pages panel
- Can’t login to my admin area
- Unable to properly login
- How to make sure your admin doesn’t hi-jack you site?
- Redirect public site to another one but allow administrators to access the old site
- How to change the descriptive text on the menus admin page?
- Dynamic WordPress Admin Panel
- Wp-Admin FTPS Connection Error unlike Filezilla
- Trying to login to my site redirects me to the first page
- ‘Conflict’ with action deleted_post and is_admin()
- issue in wordpress auto delete post and redirect to another 1
- How to update my website with WordPress?
- wordpress login loop after install
- Unable to render Admin Notices
- WordPress login not working
- Admin blank but Admin menu showing
- Pages redirect me to the homepage
- Capability to read/edit page in wp-admin only for administrators
- WP Logs me out after updating anything on dashboard
- Problems in migration of WordPress site from local server to the online server
- WYSIWYG editor not in a post editor?
- htaccess and htpasswd
- plugin to upload to youtube via wordpress [closed]
- You do not have permission to access this document on form submit
- Why when I click on a link into the WP admin panel I am redirected to a link that doesn’t contains wp-admin prefix, so I obtain 404 error
- wp-admin produces a 302 redirect to itself
- “Automatically add new top-level pages” Default
- How to determine if an admin is logged in outside the loop
- How to get view count of every page on site and add that (increasing) number to Dashboard Widget
- Dashboard menu missing
- How to disable Media Library uploads for non-Admin users?
- External HTTP API calls slowing down WordPress admin [closed]
- Passing state from child component to parent component in a Gutenberg Sidebar
- Implementing a multilingual WordPress site by installing several instances of WordPress and redirecting
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error
- 2FA for admin login only, is it doable?