Looking for a way to redirect the user from the dashboard straight to edit.php if wp_is_mobile() is true.
This is what I've tried:
function redirect_if_mobile() {
$screen = get_current_screen();
if($screen->base == 'dashboard') {
if ( wp_is_mobile() ) {
$url = admin_url( 'edit.php' );
wp_redirect( $url );
}
}
}
add_action( 'admin_menu', 'redirect_if_mobile');
The problem is that get_current_screen() isn't defined in either admin_init or admin_menu (if you hook onto admin_head instead it's too late and headers have already been sent).
Ideas?

global $pagenow; if('index.php'==$pagenow)/* etc */. Also, Adminimize has the option to hide the Dashboard menu item and redirect to other page. – brasofilo Nov 12 '12 at 23:47